Alternative for Client UI Actions in Service Portal

HV1
Mega Guru

Helsinki Service Portal does not support Client marked UI Actions. We have UI Actions on Incident form on click of which certain fields should turn mandatory on form and check for data. If the data is filled, then go ahead with server action.   We are displaying incidents on Service Portal in Form Widget. How do we replicate this behavior when working on Incident records in Service Portal Form Widget?

1 ACCEPTED SOLUTION

HI Hardik,



Honestly at the time of my reply I did not thought about that point. But I did a quick search in the documentation and it is actually pretty simple, you can use: g_form.getActionName(), which will return your UI Action name so you can make a condition based on that name.


View solution in original post

7 REPLIES 7

LaurentChicoine
Tera Guru

Hi Hardik



I did not try this but you could try to do it with an onSubmit client script for the client side and keep the UI Action server side only.


So within the onSubmit Client script, how to identify which UI Action is clicked?


HI Hardik,



Honestly at the time of my reply I did not thought about that point. But I did a quick search in the documentation and it is actually pretty simple, you can use: g_form.getActionName(), which will return your UI Action name so you can make a condition based on that name.


Hi Laurent,



I have similar requirement where we have an UI action on form (same would be available in service portal form).



onclick of this UI Action, we need to have a validation/confirmation dialog box to confirm on proceeding with action.



As suggested, we have tried onSubmit client script as below and based on action name, we will display confirmation dialog



function onSubmit() {


  //Type appropriate comment here, and begin script below


  var actionName = g_form.getActionName();


  alert(actionName);


 


}



but it is not giving any alert in service portal



Could you please help on same ASAP? we have stucked here. Quick reply would be much appreciated.



Thanks!!



Regards,


Pavan.