I dont want to update assignment group in exsisting records in request table

mania
Tera Contributor

Hi,

 

1.When we update the Assignment group values in RITM it should be reflect to the SCTASK and Request Assignment groups.
2.When we update the Assignment group values in SCTASK it should be reflect to the RITM Assignment groups.

 

For this I have wrote BRs for two tables so it is working but here my issue is when i updating that assignment group in RITM it is reflected to SCTASK and Request form but here it is updating all the exsisting request records with the same group not one record.

 

Can anyone please help on this, It will be usefull.

mania_0-1718867008053.png

mania_1-1718867025494.png

mania_2-1718867054862.png

mania_3-1718867077909.png

mania_4-1718867158271.png

 

Thanks! 

1 REPLY 1

Slava Savitsky
Giga Sage

The second query in your BR for RITM table is incorrect. You need to change this line:

gr1.addQuery('request_item', current.sys_id);

to this:

gr1.addQuery('sys_id', current.request);

 

Also keep in mind that these two BR will get you into an infinite loop unless you add conditions in your code to prevent it. You need to check the existing value of the Assignment Group in the record you are trying to update and only execute an update if the Assignment Group is not already the correct one.