how to implement save as draft for a catalog service request
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-20-2016 12:15 AM
I have a requirement where i need to implement a "save as draft" functionality for my catalog item.I have created a save as draft button using UI page on my catalog item and wrote some script to generate a service request.But i don't want that service request to proceed further on workflow for any approvals as it is in a save draft until the user submits it .Please suggest some solution.
- 5,967 Views
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-20-2016 03:28 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-12-2016 07:26 PM
Hi
I have similar requirement like creating a button as save as draft on cart and Request should be in draft state. Will you able to help?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-14-2016 04:38 AM
Hi Ashish
We have implemented this through a UI page.
Create a UI page where you need to write scripts as below and refer to this UI page from your variable of type UI page.
HTML
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<table>
<tr width="25%">
<td width="50px">
<button id="order_now" title=""
class="request_catalog_button_with_icon btn cat-btn btn-primary"
onclick="orderNowSaveAsDraft()"
type="button" href="#" style="float: left;">Save As Draft</button>
</td>
</tr>
</table>
</j:jelly>
Client Script:
function orderNowSaveAsDraft() {
//setting variable Set as draft to yes
g_form.setValue('isthisdraft','yes');//isthisdraft is a variable which is hidden on catalog form and is of type singleline textbox
//alert('Clicked draft-'+g_form.getValue('isthisdraft'));
g_cart = new SCCart();
var m = g_form.catalogOnSubmit();
if (!m)
return;
var item_guid = gel("sysparm_item_guid");
if (item_guid)
item_guid = item_guid.value;
var catalog_guid = gel("sysparm_catalog");
if (catalog_guid)
catalog_guid = catalog_guid.value;
var catalog_view = gel("sysparm_catalog_view");
if (catalog_view)
catalog_view = catalog_view.value;
g_cart.order(gel("sysparm_id").value,"1", item_guid, catalog_guid, catalog_view);
}
I hope this might help you:)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-14-2016 05:19 AM
Hi Prithvi,
I am not sure if you can hold on catalog page saying "save it as a draft", reason being the catalog page itself is a UI Page and the variables you design gets render on the UI Page.
What I would suggest is you can allow the end user to submit the request using catalog which will create a request and then you can keep your request editable until "Submit Request" UI Action on the request is clicked.
Once the UI Action is clicked that is a final submission after which you disable the variable editor.
Let me know if this works.
Thanks.
Rohant Joshi.