The CreatorCon Call for Content is officially open! Get started here.

Validate Life cycle stage fields OOB Business Rules

Sai Easwer Tej
Giga Expert

Hello All,

I have created a Data Source and Fix Script to updated "Life Cycle Stage" and "Life Cycle Satge Status" Fields. But it is not working, I got error message in Import message It is restricted a BR.

OOB BR Name: Validate Life cycle stage fields
Condition: global.CSDMUtil && global.CSDMUtil.isCSDMSupportActivationInstalled()
Script:

(function executeRule(current, previous) {
	new global.LifeCycleUtil().validateUI(previous, current);
}(current, previous));

 

Anyone can explain me what is te purpose above before Insert/update BR in ServiceNow?

Thanks 

1 REPLY 1

Tony Chatfield1
Kilo Patron

Hi, if you search for the function name in script-includes (script field) or via Studio code search you will find the function validateUI() in the script include global.LifeCycleUtil()

/nav_to.do?uri=sys_script_include.do?sys_id=e133b911b7220010ee0d3177ee11a93b

 

This function checks that the records life cycle stage and life cycle stage status are populated, and then calls private function _validateCombination() which checks to see if the records life cycle stage and life style stage status are correctly aligned.

 

Based on your post I would suspect that the values you are applying via script are not aligned in the reference table

/life_cycle_control_list.do?sysparm_query=&sysparm_view=