how to retrieve view in business rule

cc_lee
Kilo Explorer

Hi All

Anyway to retrieve view name in business rule? I tried current.view.name, view.name, sysparm_view.. but all cannot get the view. Anyone one can help?

Thank you.

9 REPLIES 9

marcguy
ServiceNow Employee
ServiceNow Employee

I believe you can use

this.getParameter('sysparm_view');

marc


marcguy
ServiceNow Employee
ServiceNow Employee

or this client script has an example too:

http://wiki.service-now.com/index.php?title=Client_Scripts#Show_or_Hide_an_Action_Button_depending_on_the_view_of_the_form



mguy


Hello,

I am trying to get the view name in order to use it in a List Control "condition" script.
The "this.getParameter('sysparm_view');" instruction does not seem to work (I have tried it in a Business Rule and a Script Includes without any luck).

Could somebody provide me with an example, or tell me if what I want to do is feasible (basically, it would be to hide the filter if the View is XXX).

Thanks a lot in advance.
Best Regards,

Alain


priya119
Kilo Explorer

Hi,
I tried to use "this.getParameter('sysparm_view');" and this seems to be not working in business rules.
Also tried the RP.getViewID() but that is also not working - getting warning - RP is not defined.
Is there any other way to access form view in business rules?

Priya.