Skip to main content
Solved

Change Responsible Person for Document Revision

  • Dec 24, 2024 1:51 PM UTC
  • 9 replies
  • 234 views

Forum|alt.badge.img+6

Hi,

 

When a new record is created on the Document Revision screen, I want IFSAPP to automatically be the responsible person of the uploaded document for a certain document class.

 

I tried to do this as an event but it doesn't seem possible. How can I do this?

Best answer by betul.bastan_12

Of course I'd like to help.

 

The code block I used for the event is like this

 

DECLARE
attr_ VARCHAR2(32000);
job_id_ NUMBER;

BEGIN

client_sys.Clear_Attr(attr_);
client_sys.Add_To_Attr('DOC_CLASS_', '&NEW:DOC_CLASS', attr_);
client_sys.Add_To_Attr('DOC_NO_', '&NEW:DOC_NO' , attr_);
client_sys.Add_To_Attr('DOC_SHEET_', '&NEW:DOC_SHEET', attr_);
client_sys.Add_To_Attr('DOC_REV_', '&NEW:DOC_REV' , attr_);
client_sys.Add_To_Attr('NEW_OWNER_', 'IFSAPP' , attr_);
client_sys.Add_To_Attr('OLD_OWNER_', '&NEW:DOC_RESP_SIGN' , attr_);
client_sys.Add_To_Attr('DEL_OLD_ACCESS_LINE_', 'TRUE' , attr_);



IFSAPP. Transaction_SYS.Deferred_Call('DOC_ISSUE_API.Update_Doc_Resp_Person', 'PARAMETER',attr_,'Change Resp Person');
END;

Transaction_SYS.Deferred_Call  ->This function creates a background job.

View original

9 replies

matt.watters
Ultimate Hero (Partner)
Forum|alt.badge.img+26
  • Ultimate Hero (Partner)
  • Dec 25, 2024 12:57 PM UTC

​@betul.bastan_12 refer to this thread regarding a custom event/action.

 


Forum|alt.badge.img+6
  • Author
  • Sidekick (Customer)
  • Dec 27, 2024 5:58 AM UTC

Thanks for your answer.
The questioner is my teammate :)
I can't use the Change Responsible Person function with an event. The event trigger and the table that the event will change are not accepted to be the same. I was trying to find an alternative solution for this.


EqeRobertK
Superhero (Partner)
Forum|alt.badge.img+15
  • Superhero (Partner)
  • Dec 30, 2024 11:15 AM UTC

Hi ​@betul.bastan_12 ,

You are right that that is not possible in case the event and the action are on the same logical unit.

But maybe you can think of another Logical Unit whet you set the event, like the Document Title (LU DocTitle), the document file LU EdmFile), or document access (LU DocumentIssueAccess). 

Hope this will help you,

Robert Kool


Forum|alt.badge.img+6
  • Author
  • Sidekick (Customer)
  • Dec 30, 2024 12:35 PM UTC

Hi ​@EqeRobertK 

 

First of all thank you for your answer.
I tried this with EdmFile LU but I get the error in the attachment.

 


Mathias Dahl
Superhero (Employee)
Forum|alt.badge.img+33
  • Superhero (Employee)
  • Jan 2, 2025 8:15 AM UTC

Thanks for your answer.
The questioner is my teammate :)
I can't use the Change Responsible Person function with an event. The event trigger and the table that the event will change are not accepted to be the same. I was trying to find an alternative solution for this.

There are ways described around the trigger and mutating table problem here on IFS Community.


Forum|alt.badge.img+6
  • Author
  • Sidekick (Customer)
  • Jan 3, 2025 12:29 PM UTC

Thanks for your answer.
The questioner is my teammate :)
I can't use the Change Responsible Person function with an event. The event trigger and the table that the event will change are not accepted to be the same. I was trying to find an alternative solution for this.

There are ways described around the trigger and mutating table problem here on IFS Community.

​@Mathias Dahl  

Yes, when I researched these and tried to adapt them to my own scenario, I was not successful at first, but I found a solution. Thank you.

 

source that helped me ; https://dsj23.me/2021/08/27/tips-to-avoid-mutating-table-error-in-ifs-event-actions/

 


Mathias Dahl
Superhero (Employee)
Forum|alt.badge.img+33
  • Superhero (Employee)
  • Jan 4, 2025 8:40 AM UTC

Thanks for your answer.
The questioner is my teammate :)
I can't use the Change Responsible Person function with an event. The event trigger and the table that the event will change are not accepted to be the same. I was trying to find an alternative solution for this.

There are ways described around the trigger and mutating table problem here on IFS Community.

​@Mathias Dahl  

Yes, when I researched these and tried to adapt them to my own scenario, I was not successful at first, but I found a solution. Thank you.

 

source that helped me ; https://dsj23.me/2021/08/27/tips-to-avoid-mutating-table-error-in-ifs-event-actions/

 

​@betul.bastan_12 

Good to hear! 😃💪🏻

Would you have time to share the final solution with the community? I'm sure others would be interested.

Thanks!


Forum|alt.badge.img+6
  • Author
  • Sidekick (Customer)
  • Answer
  • Jan 6, 2025 5:03 AM UTC

Of course I'd like to help.

 

The code block I used for the event is like this

 

DECLARE
attr_ VARCHAR2(32000);
job_id_ NUMBER;

BEGIN

client_sys.Clear_Attr(attr_);
client_sys.Add_To_Attr('DOC_CLASS_', '&NEW:DOC_CLASS', attr_);
client_sys.Add_To_Attr('DOC_NO_', '&NEW:DOC_NO' , attr_);
client_sys.Add_To_Attr('DOC_SHEET_', '&NEW:DOC_SHEET', attr_);
client_sys.Add_To_Attr('DOC_REV_', '&NEW:DOC_REV' , attr_);
client_sys.Add_To_Attr('NEW_OWNER_', 'IFSAPP' , attr_);
client_sys.Add_To_Attr('OLD_OWNER_', '&NEW:DOC_RESP_SIGN' , attr_);
client_sys.Add_To_Attr('DEL_OLD_ACCESS_LINE_', 'TRUE' , attr_);



IFSAPP. Transaction_SYS.Deferred_Call('DOC_ISSUE_API.Update_Doc_Resp_Person', 'PARAMETER',attr_,'Change Resp Person');
END;

Transaction_SYS.Deferred_Call  ->This function creates a background job.


Mathias Dahl
Superhero (Employee)
Forum|alt.badge.img+33
  • Superhero (Employee)
  • Jan 10, 2025 12:12 PM UTC

Thanks ​@betul.bastan_12 !