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 93a8b28 commit 5f56f97Copy full SHA for 5f56f97
Client-Side Components/Catalog Client Script/catalog Draft/client script.js
@@ -0,0 +1,19 @@
1
+function onLoad() {
2
+ console.log('Auto Save Draft initialized');
3
+
4
+ setInterval(function() {
5
+ var draftData = {
6
+ hardware_name: g_form.getValue('hardware_name'),
7
+ quantity: g_form.getValue('quantity')
8
+ };
9
10
+ var ga = new GlideAjax('CatalogDraftUtils');
11
+ ga.addParam('sysparm_name', 'saveDraft');
12
+ ga.addParam('sysparm_catalog_item', g_form.getValue('sys_id')); // Catalog item sys_id
13
+ ga.addParam('sysparm_draft_data', JSON.stringify(draftData));
14
15
+ ga.getXMLAnswer(function(response) {
16
+ console.log('Draft saved: ' + response);
17
+ });
18
+ }, 120000); // Every 2 minutes
19
+}
0 commit comments