How to set the short description of the REQUEST same as the record producer on the portal, when record is submitted.WITHOUT USING WORKFLOW

Not applicable

When request is created the Short description is not set to the short description on the catalog item on submit.
How can this be achieved without using the Workflow.

I want to set the Request short description to the short description user entered while submitting the form.

This short description on the RITM is populating, I want to populate the Request. so that.
The short description on Request = short Description on RITM;

Thanks in advance,
@Ankur Bawiskar 


@Deepshikha Pandey @Deepshikha Pandey @Ankur Agarwal  

1 ACCEPTED SOLUTION

This was populating the Request form Name 

I wanted to get the vriable value on the form and submit it on the request.

I made these changes and it worked for me:


var req = current.request.getRefRecord();
req.short_description = current.variables.short_description; /* made this changes and it worked as
expected for me*/
req.update();
})(current, previous);

View solution in original post

4 REPLIES 4

Harish KM
Kilo Patron
Kilo Patron

Hi you can use a after insert BR on ritm table to set request shortdescription 

var gr = new GlideRecord('sc_request');
gr.addQuery('sys_id', current.request);
gr.query();

if(gr.next())

{

gr.short_description = current.short_description;
gr.update();


}

Regards
Harish

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

you can use after insert BR on RITM table

Script:

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

Regards
Ankur

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

This was populating the Request form Name 

I wanted to get the vriable value on the form and submit it on the request.

I made these changes and it worked for me:


var req = current.request.getRefRecord();
req.short_description = current.variables.short_description; /* made this changes and it worked as
expected for me*/
req.update();
})(current, previous);

Hi,

The script I shared will also work fine since you are already populating the variable value into RITM short description which in turn will get copied to REQ short description.

Would you mind marking appropriate response as correct?

Regards
Ankur

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