Business rule to stop record creation

bonsai
Mega Sage

I want to create a business rule that works when creating a record.

I want to stop creating a record if the value I put in the corresponding field of the record is a specific value.

How should this be implemented?

1 ACCEPTED SOLUTION

Jaspal Singh
Mega Patron
Mega Patron

I want to create a business rule that works when creating a record.

Business rule with Insert: True on required table

 

I want to stop creating a record if the value I put in the corresponding field of the record is a specific value.

In the same Business Rule you need to check

if(current.field_name1=='aBC')//Replace field_name1 with correct field & ABC with required value

{

current.setAbortAction(true); //aborts action 

}

else {

//do nothing & let record get created or your logic

}

 

View solution in original post

3 REPLIES 3

Jaspal Singh
Mega Patron
Mega Patron

I want to create a business rule that works when creating a record.

Business rule with Insert: True on required table

 

I want to stop creating a record if the value I put in the corresponding field of the record is a specific value.

In the same Business Rule you need to check

if(current.field_name1=='aBC')//Replace field_name1 with correct field & ABC with required value

{

current.setAbortAction(true); //aborts action 

}

else {

//do nothing & let record get created or your logic

}

 

Kartik Sethi
Tera Guru
Tera Guru

Hi @盆巣

 

For point#I want to create a business rule that works when creating a record:

find_real_file.png

For point#I want to stop creating a record if the value I put in the corresponding field of the record is a specific value

Step1:

find_real_file.png

Step2:
find_real_file.png


Please mark my answer as correct if this solves your issues!

If it helped you in any way then please mark helpful!

 

Thanks and regards,

Kartik

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

so what script did you write and where are you stuck?

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader