How to check for workspace view in Business Rule ?

Yogesh32
ServiceNow Employee
ServiceNow Employee

Hi,

I have a use case where I am displaying the 'kb_quality_checklist' list in Agent Workspace. There is a business rule 'Display error message' that runs on display of the 'kb_quality_checklist' form. In the condition of this business rule, there is a check using 'RP.getViewID()'. However, RP is not defined in agent workspace. So this throws up a runtime error whenever I open the form. I have tried checking whether RP is defined in the condition by using 'typeof RP != 'undefined', however this change throws up an evaluator error whenever the form is opened in platform. 

So my question is that is there any way to check whether the business rule that triggers on display is running on standard platform view or in the workspace view ? 

Thanks.

Yogesh.

2 REPLIES 2

GordonBanks
ServiceNow Employee
ServiceNow Employee

Hi Yogesh

 

The way I have achieved this is to wrap it in a try catch

var isWorkspace = false;
try {
	isWorkspace = (typeof RP === 'undefined');
}
catch (err) {
	isWorkspace = false;
}

In this way you can check and evaluate

This did not work. Any suggestions would be really helpful!

Regards,

Arpitha G