Skip to main content
Question

IFS Cloud Send Push Notification to MWO


Hello,

 

Does someone know how to create a custom event that after being triggered sends a push notification into MWO, if the Miscellaneous Resource Allocation status goes into Accepted?

 

Thank you for the Help,

Francisco Lopes

13 replies

Userlevel 7

You should be able to use the function behind the “Send Notification” on the “Installed App Details” page. 
This will trigger Mobile_Push_Sys.Execute_User_Ntfy_Job__ which in turn will send the notification through a background job.

You will need to provide values for the parameters 

MESSAGE_  - What should the push notification say

APP_NAME_LIST_ - Which app are you sending it to

USER_ID_LIST_ - What is the username/s you are sending it to.

DEVICE_ID_LIST_ - Which device/s are you sending it to.

Badge +5

Could you elaborate a bit, I’m searching for “Installed App Details” and I can’t find it. Do I create a custom event and then in the custom action i call the send notification?

 

Thank you

Userlevel 7

Could you elaborate a bit, I’m searching for “Installed App Details” and I can’t find it. Do I create a custom event and then in the custom action i call the send notification?

 

Thank you

Which version are you on? Can you share a screenshot?


You’d have a custom event that triggers on e.g. your RMA approval. That would trigger a SQL statement where you’d trigger the notification. Something like below (it’s just an example, not tested and probably not 100% correct). 

You’d obviously have to replace the values for the variables through some sort of cursor or attributes from the event.

 

DECLARE

 message_  VARCHAR2(3000) := 'Your MRA has been approved';
 app_name_ VARCHAR2(200) := 'ServiceEngApp';
 user_id_list_ VARCHAR2(200) :=’USER_ID’
device_id_list_ NUMBER := 1;

BEGIN
   
      Client_SYS.Clear_Attr(attr_);
      Client_SYS.Add_To_Attr('MESSAGE_', message_, attr_);
      Client_SYS.Add_To_Attr('APP_NAME_', app_name_, attr_);
      Client_SYS.Add_To_Attr('USER_ID_LIST_', user_id_list_ , attr_);
      Client_SYS.Add_To_Attr('DEVICE_ID_LIST_', device_id_list_ , attr_);

      Transaction_SYS.Deferred_Call('MOBILE_PUSH_SYS.Execute_App_Ntfy_Job__',
                                    'PARAMETER',  
                                    attr_, 
                                   'Posting approval notification'));

END;

 

Badge +5

I’m in version 24R1

 

Is this line for 24R1?
Transaction_SYS.Deferred_Call('MOBILE_PUSH_SYS.Execute_App_Ntfy_Job__',                                     'PARAMETER', attr_, 'Posting approval notification'));

I found this:
 

But I’m not sure if it’s for version 24R1.

Userlevel 7
Badge +20

@anmise and I have slightly modified the code and confirmed it works on 24R1. Note that for testing all parameters have been hard-coded, but from here it’s probably easy for you to enhance.

DECLARE
message_ VARCHAR2(3000) := 'MRA has been created';
app_name_ VARCHAR2(200) := 'ServiceEngApp^';
user_id_list_ VARCHAR2(200) := 'ALTONL^';
device_id_list_ VARCHAR2(200) := '3^';
attr_ VARCHAR2(1000);

BEGIN
Client_SYS.Clear_Attr(attr_);
Client_SYS.Add_To_Attr('MESSAGE_', message_, attr_);
Client_SYS.Add_To_Attr('APP_NAME_LIST_', app_name_, attr_);
Client_SYS.Add_To_Attr('USER_ID_LIST_', user_id_list_, attr_);
Client_SYS.Add_To_Attr('DEVICE_ID_LIST_', device_id_list_, attr_);

Transaction_SYS.Deferred_Call('MOBILE_PUSH_SYS.Execute_User_Ntfy_Job__',
'PARAMETER',
attr_,
'Posting approval notification');
END;

 

Badge +5

Thank you, one more question, after deploying this code, do I need to do anything in IFS Cloud, or it appears when i try to create a custom event that calls an online sql function?

 

Badge +5

Do i need to include the device_id_list, becuase i want to sent the notification to all the devices of a certain user

Userlevel 7
Badge +20

Thank you, one more question, after deploying this code, do I need to do anything in IFS Cloud, or it appears when i try to create a custom event that calls an online sql function?

 

I did put the code directly into the event action, it will be effective immediately (in Developer Studio this is likely different). And I don’t know if there is a way to send a message to all devices, the UI only allows this per device. You may need to include all of them.

@James Ashmore can you help: Is there a way to send the message to all devices of a user w/o listing them?

Badge +5

In case i need to add all the devices, do I just need to include a varchar variable with all the devices separated by a “,”?

Userlevel 7
Badge +20

In case i need to add all the devices, do I just need to include a varchar variable with all the devices separated by a “,”?

Cannot try myself but would guess that's right. Something like '1,2,3^'

Badge +5

what is “^”

Userlevel 7
Badge +20

what is “^”

Delimiter… Just like in the other variables.

Userlevel 7
Badge +20

@FLopes and everyone interested in this: Please find a sample in the attached document.

Reply