Create another RITM when checkbox is set to true

jeansky
Tera Contributor

Hello good day,

How I can create another RITM when checkbox is true? So this catalog variable (checkbox) is only visible in variable editor, so when the fulfiller check the checkbox it will generate another RITM. How I can do it in flow designer? Any idea will be appreciated.

jeansky_0-1715156523826.png

 

Thank you so much.

 

1 ACCEPTED SOLUTION

Sohail Khilji
Kilo Patron
Kilo Patron

Hi @jeansky ,

 

You can do this in multiple ways you can make use of your existing workflow or flow / create a busness rule.

 

if its workflow you can create a wait for conditon untill the check box is to true. if its true you can run the below script to create a RITM.

 

or you can create a business rule to create a rimt and relate it to existing request.

 

(function executeRule(current, previous /*null when async*/) {
    // Check if the checkbox variable is true
    if (current.checkbox_variable == true) {

        var newRITM = new GlideRecord('sc_req_item');
        newRITM.initialize();
        newRITM.request = current.request; 
        newRITM.cat_item = current.cat_item;
        newRITM.requested_for = current.requested_for;
        newRITM.assignment_group = current.assignment_group; 
        newRITM.insert(); // Insert the new RITM record
    }
})(current, previous);

☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....

LinkedIn - Lets Connect

View solution in original post

5 REPLIES 5

Anubhav24
Mega Sage
Mega Sage

Hi @jeansky ,

 

You can also make use of Cart API to create a new RITM in your script. 

Please mark helpful/correct if my response helped you.