Skip to main content
Solved

Change Responsible Person for Document Revision

  • December 24, 2024
  • 9 replies
  • 135 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
Did this topic help you find an answer to your question?

9 replies

matt.watters
Superhero (Partner)
Forum|alt.badge.img+25
  • Superhero (Partner)
  • 566 replies
  • December 25, 2024

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

 


Forum|alt.badge.img+6
  • Author
  • Sidekick (Customer)
  • 12 replies
  • December 27, 2024

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)
  • 231 replies
  • December 30, 2024

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)
  • 12 replies
  • December 30, 2024

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+32
  • Superhero (Employee)
  • 2824 replies
  • January 2, 2025
betul.bastan_12 wrote:

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)
  • 12 replies
  • January 3, 2025
Mathias Dahl wrote:
betul.bastan_12 wrote:

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+32
  • Superhero (Employee)
  • 2824 replies
  • January 4, 2025
betul.bastan_12 wrote:
Mathias Dahl wrote:
betul.bastan_12 wrote:

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)
  • 12 replies
  • Answer
  • January 6, 2025

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+32
  • Superhero (Employee)
  • 2824 replies
  • January 10, 2025

Thanks ​@betul.bastan_12 !


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings