Need to Update catalog variables in RITM.

Ram33843094
Tera Contributor

Need to Update catalog variables in RITM.

 

These catalog variables are stored in item_option_new table, but not on requested item table sc_req_item.

 

These variables should get updated when record producer is submitted(same variables filled in RP) or from generated HR LE Case(all those variables avail in this table too).

 

Can someone please share any script to map these catalog variables.

 

@Ankur Bawiskar @Community Alums @Allen Andreas @AndersBGS 

6 REPLIES 6

AnveshKumar M
Tera Sage
Tera Sage

Hi @Ram33843094 ,

Are you using RP to create HR LE case and you are creating RITM record at the same time? How you are creating an RITM, is it through the RP Script?

 

Thanks,

Anvesh

Thanks,
Anvesh

Hi Anvesh

Yes Im using RP to create HR LE Case and I have created a lifecycle event with activities to trigger REQ's(and their respective RITM's) as soon as HR LE case is generated.

 

@AnveshKumar M 

@Ram33843094 ,

 

You can do this in the following manner, before you begin, get the sys_ids of questions in record producer, their values (you can glide the HR LE Case record and store them in some variable) and the sys_id of RITM.

 

var ritm_sys_id = 'YOUR_RITM_SYS_ID';

var question_1 = 'SYS_ID_OF_QUESTION_1_IN_RP';
var answer_1 = 'VLAUE/ANSWER OF THE QUESTION1';

//Store answer for the question

var opGr = new GlideRecord('sc_item_option');
opGr.initialize();
opGr.item_option_new = question_1;
opGr.value = answer_1;
var qopID1 = opGr.insert();

// Relate the question_answer stored in previous step to the RITM

var relGr = new GlideRecord('sc_item_option_mtom');
relGr.initialize();
relGr.request_item = ritm_sys_id;
relGr.sc_item_option = qopID1;
relGr.insert();

 

You can repeat the above script for all the questions in your RP.

 

Thanks,

Anvesh

Thanks,
Anvesh

Hi Anvesh,

 

In the first step how can we give single RITM sys_id as value. We will dynamically generate different RITM's each time when we submit RP.

 

And to glide the HR LE Case Record,  we have already mapped the fields from RP(map to field) to HR LE table. Whatever the data submitted on RP, will enter the variables in HR LE Case form too.

 

So can we map variables directly from HR LE Case to RITM?    (but variables are stored in item_option_new, not in sc_req_item)

 

OR

 

Do we make any changes to the above script, as we cant give sys_id of particular RITM right

 

@AnveshKumar M