Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Unique GuidID for the CartJS API var cart = new sn_sc.CartJS(gs.generateGUID()); is not working.

Girisha
Tera Contributor

ServiceNow suggested using a Unique GuidID for the CartJS API "

var cart = new sn_sc.CartJS(gs.generateGUID());" to address a duplicate RITM issue. However, after implementing this solution, only the Request is being created, and the RITM is not generating. Any assistance on this matter would be greatly appreciated. Thank you!

 

 

        var cartid = "cart_" + gs.generateGUID();
        var cart = new sn_sc.CartJS(cartid);

        var request = {
            'sysparm_id': 'e8747cf17c23150049d0205f9e6396fb',
            'sysparm_quantity': '1',
            'variables': {
                'email': email.body_html,
                'offBoardingComments': 'received from: ' + email.origemail,
                'name': usersysID,
                'manager': manager,
                'last_day': email.body.end_date,
                'end_date': email.body.end_date,
                'req_via_email': true
            }
        };


        cart.setRequestedFor(usersysID);

        var cartDetails = cart.orderNow(request);
0 REPLIES 0