Change Record creating duplicates records with same change number

avinash1289
Tera Contributor

avinash1289_0-1724175415758.png

Change Record creating duplicates records with same change number

 

2 REPLIES 2

Sandeep Rajput
Tera Patron
Tera Patron

@avinash1289 Number is not a Unique field and at times you may have some duplicate numbers in your table. Following are some of the reasons for it.

1. Change record imported from some other instance.

2. An API sync caused the duplicate number

 

Change request has sys_ids as a unique identifier.

Sumanth16
Kilo Patron

Hi @avinash1289 ,

Can you elaborate more on this issue. Is there any business rule triggering multiple times (or) are you creating change request from standard change the template?

You can use business rule (or) unique field option on number field.

Configure below script for validation purpose:

//For CHG Request (Before Insert BR)

var gr = new GlideRecord('change_request');

gr.addQuery('number',current.number);

gr.query();

if(gr.next()){

current.setAbortAction(true);

gs.addInfoMessage('Number is Duplicate');

}

 

please mark it as helpful and "accept as solution".

 

Thanks & regards,

Sumanth meda