How to get action name in a Business Rule (Server Side script)

harinalamalapu
Giga Expert

I know 'g_form.getActionName()' can be used in client-side script to identify the action name, what is the equivalent command on a server-side script ? I will need to identify the action that triggered the business rule to add a condition (on the business rule condition field or the script) based on that.

11 REPLIES 11

Hi Pradeep, Looks like the link you shared to identify the action name is for Client Scripts. But I will need something like that on a Business Rule. Please take a look at the context below to better understand my requirement :



I am implementing a Business Rule as in the question - Point Create New to Record Producer. I am trying to add some logic in the business rule such that 'Copy Change' doesn't get redirected to Record Producer. So I am basically trying to identify the button/link behind the trigger.


In the thread I referred, did you get a chance to look the section


Identifying the action name in a business rule

Yes Pradeep, I referred to that and noticed 'action.getActionName()' used to be an option in Business Rule but it has been removed by Service Now. Am I missing something that helps my problem from the article ?


icerge
Giga Contributor

Unless, there is a better option, you can achieve it by treating "current" GlideRecord object as a javascript object. Set a temporary (i.e. runtime) attribute of "current" object and read it in a business rule.


UI Action:


...


current.t_source_ui_action = "copy_change";


current.update();


...



Business rule run condition:


current.t_source_ui_action == "copy_change";