How to create a catalog item from scheduled job

shaikimran4
Tera Contributor

I have a requirement to create a catalog item bi-weekly automatically without manual intervention. I am trying this logic in scheduled Job, but it is working. but when I try in Background scripts it is working as expected.

 

var cart = new sn_sc.CartJS();
var newItem = cart.addToCart({
    "sysparm_id": "04b7e94b4f7b4200086eeed18110c7fd",
    "sysparm_requested_for": "62826bf03710200044e0bfc8bcbe5df1",
    "variables":{
        "acrobat": "true",
        "photoshop": "false",
        "Additional_software_requirements": "testing the software"
    }
});
var checkoutInfo = cart.checkoutCart();
 
 
Can someone help me out on this.
6 REPLIES 6

Ankur Bawiskar
Tera Patron

@shaikimran4 

as per your question you said it's working from both scheduled job and background script

so what's your question?

AnkurBawiskar_0-1763041917828.png

 

💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏