We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 69bdfc6 commit 8575dc9Copy full SHA for 8575dc9
Server-Side Components/Background Scripts/Create Request through script/create_request_using_script.js
@@ -0,0 +1,24 @@
1
+
2
+var cart = new sn_sc.CartJS();
3
+//define variables
4
+var itemDetails = {
5
+ 'sysparm_id': 'catalog_item_sys_id',
6
+ 'variables': {
7
+ 'requested_for': 'user_sys_id'
8
+ /*
9
+ .
10
11
+ remaining variables
12
13
14
+ */
15
+ }
16
+};
17
18
+// Add item to cart (returns item sys_id within the cart)
19
+var cartItem = cart.addToCart(itemDetails);
20
+gs.info('Added catalog item to cart: ' + cartItem);
21
22
+// -- Place the order ---
23
+var order = cart.checkoutCart();
24
+gs.info('Order placed successfully. Request Sys ID: ' + order.request_id);
0 commit comments