Request (sc_request) short description update as catalog name

Debasis Pati1
Tera Contributor

My requirement was for a particular category items the request short description should be same as the catalog item name.

 

so i wrote a simple business rule on ritm below

find_real_file.pngfind_real_file.png

 

Now i don't know what's wrong in it but i am getting rowcount 0 and as well the script doesn't enter inside the loop.

 

 

 

Regards,

Debasis

10 REPLIES 10

Hi @Debasis Pati ,

you created after business rule on sc_req_item table is that correct?

If Yes check request field on RITM table whether it has request or not?

Once it is triggering conditions and going to script then you need to check or debug in the script.

Try to use same script which I gave above and replace with your field names.

if there is any type error it will not work.

 

Regards

Pavankumar

If it helps please click Accept as Solution/hit the Thumb Icon.
ServiceNow Community MVP 2024.
Thanks,
Pavankumar

Ankur Bawiskar
Tera Patron
Tera Patron

Hi @Debasis Pati 

you can use after insert BR on RITM table and use this script

I hope your BR condition is correct and considering BR triggers the below script I shared will work fine

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

	var req = current.request.getRefRecord();
	req.short_description = current.cat_item.getDisplayValue();
	req.update();

})(current, previous);

Regards
Ankur

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

Hi @Debasis Pati 

Hope you are doing good.

Did my reply answer your question?

If my response helped please close the thread by marking appropriate response as correct so that it benefits future readers.

Regards
Ankur

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

Hi @Debasis Pati 

Hope you are doing good.

Did my reply answer your question?

If my response helped please close the thread by marking appropriate response as correct so that it benefits future readers.

Regards
Ankur

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

Pavankumar_1
Mega Patron

Hi @Debasis Pati 

If it is resolved please close the thread by Marking as  Correct so that other readers will get benefit if they have similar question.

In future they will refer this one get benefited or let us know if still not resolved.

Hope you understood.

 

Regards

Pavankumar

If it helps please click Accept as Solution/hit the Thumb Icon.
ServiceNow Community MVP 2024.
Thanks,
Pavankumar