Urgent pls: (g_form.getActionName()=='sysverb_update_and_stay' || g_form.getActionName()=='sysverb_update' ) in BR

Ashirav
Tera Expert

Hi.

I have to transfer contents of a Client Script in a Business Rule.

The following statements of the client script, i dont know how to convert to a business rule:-(g_form.getActionName()=='sysverb_update_and_stay' || g_form.getActionName()=='a831a099dbfe1b8057a9ffe61d961945' || g_form.getActionName()=='sysverb_update' ).

I am unable to find the relevant BR functions. Please help.

1 ACCEPTED SOLUTION

if i look into your client script , i can see the most of the action name works for update operation. so if you will use the business rule on update operation ( set update as true) then it should work. no need to check action name. 

View solution in original post

10 REPLIES 10

Ashutosh Munot1
Kilo Patron
Kilo Patron

Hi,

I understand. But what is your use case? Because this is something which happens when you click on UI Action.

Thanks,
Ashutosh

Harsh Vardhan
Giga Patron

 

why business rule ? may i know the use case ?

Ashirav
Tera Expert

Thanks for responding harshvardhan and ashutosh. I am not sure what you mean by use case.

I have a button which adds additional comments and I have some BR which get triggered when adding the comments to the incident form. So when the comments get added, the br get triggered. BUT THE CLIENT SCRIPT DOESNT GET A CHANCE TO TRIGGER BECAUSE THE BR GOT TRIGGERED BEFORE THAT. So I am trying to copy the client script contents to a third BR so that when BR runs, the content of CS which got skipped, runs as well.

Below is if conditions of the CS code and BR code I am trying to use in:-

 

Client Script:

if(getView()=='ess' && (g_form.getActionName()=='sysverb_update_and_stay' || g_form.getActionName()=='a831a099dbfe1b8057a9ffe61d961945' || g_form.getActionName()=='sysverb_update' ))// && g_form.getActionName()=='sysverb_update')
g_form.setValue('u_source','Portal');

 

Business Rule:

var view_name='';
if (gs.getSession().isInteractive()) {
var map = gs.action.getGlideURI().getMap();
if (map.get('sysparm_view') != null) {
view_name= map.get('sysparm_view').toString();
}
}
gs.log('ASHI View: '+view_name);

if(view_name == 'ess' && /*Here will come the client script lines*/){
current.u_source = 'Portal';
}

 

 

I should also mention here that the code for fetching view isnt working either.

Hi,

Are you testing it in proper view? Silly but please check it once.


Thanks,
Ashutosh