Question

Custom event action on procedure/method

  • 15 August 2022
  • 7 replies
  • 345 views

Userlevel 2
Badge +4

Hi,

I am setting up an event that triggers when a new purchase order is created - it is looking at one parameter on the supplier side and returns an information message depending on said parameter.

It works fine when creating a purchase order from scratch. However, event does not trigger when creating a purchase order via the ‘Copy Order...’ RMB option. When looking at what’s happening (in the debug console), I see that the method Purchase_Order_API.Copy_ is used. Is there a way to make the event works after the copy order action is executed?

This is what is set up, for reference:

  • Event:
  • Event action:

 


7 replies

Userlevel 5
Badge +13

Hi @Alexis.S,

Remove the condition in the custom event and check whether the information message is triggered for “copy Order” RMB option. Make sure the segmenet_code is %RED%.

 



Hope this helps!

Best Reards,
Bhagya

Userlevel 2
Badge +4

Hi @Bhagya Wickramasinghe ,

I’ve tried that, but event still does not trigger when I copy order. No issue with the segment code, as event triggers when I create PO from scratch and supplier has RED in its segment code.

 

Regards,

Alexis

 

Userlevel 5
Badge +13

Hi @Alexis.S,

The event triggers during copy order RMB process. But I didn’t use the event action condition. May be that is not tallying. 
Remove the condition from the event action and print the segment_code value in your information message and try to identify the event action condition discrepency.

Best Regards,
Bhagya

Userlevel 6
Badge +15

Perhaps CLIENT_SYS.Add_Info cannot be used when Copy_Order is used

 

To test this, change to CLIENT_SYS.RECORD_GENERAL(‘’,MESSAGE_) and see if the error message appears upon creation and copy.

 

If this is the case you have to think of another solution such as:

Trigger a steams message to the user

Email the user

 

Or if you 100% need to them to read the message before they save the record then leave it as RECORD_GENERAL and have a custom field on the page which is by default unchecked. The user could then check it, and if it is checked then you could avoid showing the error message. (However some users my just get into the habit of selecting the checkbox by default before saving the record every time)

 

Callum

 

Userlevel 2
Badge +4

@CallumW 

I tried your suggestion but got an error message when I try to copy (or create). Eventually figured out that record_general is used with Error_Sys. In that case, the message indeed pops up when I want to copy - but prevents user from proceeding. The custom field solution would work when creating a PO from scratch. However, it would not work when copying one (user would be stuck on the Copy Order wizard).

I’ll see if I can figure out something else otherwise I’ll discuss with the end user if alternative solutions you suggest (streams message / email) is acceptable.

 

Regards,


Alexis

Userlevel 6
Badge +15

@Alexis.S  Ahh yes… ERROR_SYS, it’s been a while since I’ve used it, apologies if I caused any confusion. 
 

True on the custom field copy function, didn’t think of that. Looks like a stream message/email might be your only option (Or a Mod from IFS)

 

Callum
 

 

Userlevel 2
Badge +4

@CallumW Just to provide a final feedback. After discussing with the end user, we went a different route, with a combo event / check box. The event triggers an error message when releasing the PO (instead of doing so at creation stage) asking user to double check and tick a custom checkbox.

 

Regards,


Alexis

Reply