I’m attempting to trigger a Streams notice on a failed background job. I’ve gotten the event to trigger, however, I am trying to further filter notification by adding a condition for the event based on the site the error occurred at. I’ve noticed that in the Argument field, the actual site name is contained and I thought that I could use wildcards to trigger when that value is present. However, it appears I do not have it configured correctly. I was attempting to use the LIKE condition with wildcards, and I also attempted to use the “=” condition with no luck. The syntax used for both is below:
The argument field contain a long string of text, but the contract site does appear in the string. I’m hoping that I’m using the condition and wildcards incorrectly. Any help would be greatly appreciated.
Page 1 / 1
The tricky part here is extracting the relevant data from the argument string and what you can do in the event action condition is pretty limited.
My suggestion would be to utilise a PLSQL event action instead to drive the stream notification. You still have the background job’s argument substitution field that you can use to condition the event action but you will be doing this in code form. To extract the data from the argument field use the following.
Then you would construct an IF statement using the site_ variable to drive the condition and within the IF statement you would invoke the code to generate the stream notification.
I don’t think Client_SYS.Get_Item_Value would work as it isn’t split by characters as such in this case.
You could add a custom attribute on the event with the following code:
And then in the event action condition use the custom attribute and just put your site in you wish the event to trigger on.
REGEXP_REPLACE - strips non printable characters and replaces with semi colon
The rest of the code looks where the location where text CONTRACT is found and uses this as the starting position (+1 as skips over the ;)
Then find the next ; after the site to find the end of the site name and use this to get the site from the string.
P.s. I haven’t tested the full solution, only that the substr and instr are correct
We use something like this. You’ll need to set up an HTML mail sender in IFS Connect.
In addition to a list of IT users, this copies the user who triggered the error.
I changed the CSS here because it had our company brand fonts and colors. You might want to play with those.
/* Event Logical unit AbcClass Table TRANSACTION_SYS_LOCAL_TAB Event only when STATE is changed New values for these: ARGUMENTS_STRING DESCRIPTION ERROR_TEXT ID PROCEDURE_NAME STATE USERNAME
Event Action Only when NEW:STATE = Error Execute Online SQL
I’ve recently setup email alerts For background job errors via a custom event which do the trick for me. Let me know if you need help
UPDATE - We ended up going at this a different way. We’re using the WADACO system in IFS Apps 10. By using the handheld scanner we can take advantage of the Data Collection Sessions in IFS. I’ve configured Event Actions and split them according to site. This also allows me to pull the error message out for the receive shop order.