We're reclaiming inactive PDIs to keep them available for active builders. Learn what's changing, who's affected, and how to protect your work. Read More

Cart Api is not working

gginjupa
Tera Contributor

I am using the Cart API to create a catalog item , but for first time when I create a request, the data is not populating in the variables but when I submit the request second time request is creating and variables are populating with data .

  I am attaching the screen shot of the code that I am using to create a catalog item.

 

can any one help with issue.

 

2 REPLIES 2

sachin_namjoshi
Mega Patron

Use below code

 

var cart = new global.Cart(gs.generateGUID());
var item = cart.addItem('30db7eb84fd95740dc984da28110c7af');// update sys_id of catalog item
cart.setVariable(item,'requested_for',current.caller);
var rc = cart.placeOrder();

 

Regards,

Sachin

Hi Sachin, 

The above code works, but sometimes I still see the issued , that data is not populating in the variables in catalog item.

I am attaching the screen shot of the variable.

 

can you help me the issue.

find_real_file.png