Creating RITM form script

Kalyani35
Tera Guru

Hi,

We have a requirement to create multiple RITMs from script.

With the script I am able to create the RITMs but somehow the variables are not visible on those RITMs created from script.

Looks like the link between RITMs and variables is missing.

Please look script below. How this can be solved?

 var grRITMRecUpdate = new GlideRecord('sc_req_item');
                    grRITMRecUpdate.initialize();
                    grRITMRecUpdate.cat_item = 'c7f12469478fe9502bb635a2e36d43cf';
                    grRITMRecUpdate.request = ritmID.request;
                    grRITMRecUpdate.short_description = ritmID.short_description;
                    grRITMRecUpdate.insert();
                   

 

2 REPLIES 2

Maik Skoddow
Tera Patron
Tera Patron

Hi @Kalyani35 

you cannot use a simple GlideRecord as in the background many tables have to be filled.

Instead use the CartJS API. The following documentation has lots of examples embedded: https://developer.servicenow.com/dev.do#!/reference/api/tokyo/server/sn_sc-namespace/c_CartJSScoped

Maik

Hi Maik,

Thanks for reply.

We actually want to create multiple RITMs based on the excel file attached on the request. Can we do it using cart api? Can you suggest the approach please.

 

Thanks