How to run a business rule on change of the field in the form

Learn SN
Tera Contributor

Hello experts,

 

I have a question, 

I want that when a user changes the value of a field on incident form, a business rule is called.

 

I know it is easy to do with client script ( onchange type) , but in my case, I want a business rule to be called.

 

Can someone please help ?

 

 

Thanks!

 

13 REPLIES 13

Pranay Tiwari
Kilo Guru

Hi,

 

Yes you can,give onChange condition in When to run then write a script for what you want to achieve or through Action.

 

Mark correct or helpful if it helps you.

 

Warm Regards,

Pranay Tiwari

| www.DxSherpa.com |

On chnage is for client script. 

 

for business rule, we have before /after insert update. We do not have onchange in business rule.

 

 

i mean to say when a user changes(onChange) the value of a field on incident form,BY which field value change's you want to call BR.

In condition block.

Like that,

give any condition

 

 

 

you also give condition in script ,

 

 

below code perform onChange functionality,because it will compare current & previous values and on the basis of this it will take action.

 

so as below you will compare current & previous value for perform onChange action. 

(function executeRule(current, previous /*null when async*/) {

	if(current.short_description!=previous.short_description)
{
	current.description = previous.short_description;
}
	else{
		current.short_description="";
	}
})(current, previous);

 

Mark correct or helpful if it helps you.

 

Warm Regards,

Pranay Tiwari

| www.DxSherpa.com |