Shopping Cart-Making fields mandatory/Special instructions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-06-2016 12:16 PM
Good afternoon guru's......
One of our VP's is requesting an enhancement that requires each service catalog request to include a business justification. Since this is coming from upper management, it's critical we provide this business requirement. After several days of research and playing in my own sandbox instance -- we have determined that we want to make Special instructions a mandatory field on the checkout page. (Or another option is to create a new field -- and that field must be updated/included on the request. We are open to suggestions.)
Here is where we are in the process.....
- Using the awesome post from the SNGuru blog: Mandatory Fields on Service Catalog Checkout Form - ServiceNow Guru --the information is great starting point. However, the content is a little outdated and it did not work in Fuji. (I'm assuming this content was posted under Eureka.)
- Afer a little more research and I have found the correct answer to this post helpful. (Disabled the use sc_cart_layout in Catalog Properties.) However, it works/but it doesn't......and this is where we are stuck...
- It Works when:
- It does not allow me to continue if the special instructions field is blank. I get a pop up saying "You need to enter information in the speical instructions field".
- It Doesn't Work when:
- The special instructions field contains text, nothing happens when I click the SUBMIT button. Why? What am I missing?
- The top right hand corner SUBMIT button disappears after I disable the sc_cart_layout. Why? Should I be modifying the macro button instead?
- It Works when:
We understand we have modified the oob sc_cart_template macro and from here on out we own it with no support or updates from ServiceNow. With that said...what is best practice? Should we modify the sc_cart_checkout_template or should we create a new button macro (copy the existing XML footer button macro and create/paste/modify the XML in the new macro).
I'm open to suggestions -- bottom line is we need to provide our financial approvers a business justification when they need to approve the request that is submitted to purchase something. We intend to provide the SPECIAL INSTRUCTIONS in the financial approver e-mail notification. This business justification should come from the requestor.
Can anyone provide feedback / help / further instructions? I can provide access to my dev sandbox if you need to see it happening or look at any code.
So much thanks in advance!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2016 09:20 AM
Hi Jenni,
Have you considered using a Justification variable on your Catalog Items? This would move the justification information from the Request level to the Requested Item level. The benefit that I have seen from this in the past is that if I have multiple items in my order I may have different justifications for each item, or different approvers for each item. Ultimately this comes down to how your process is setup. If your financial approvers are approving the entire order at once, this approach doesn't work, but if they review each item rather than request I have seen this approach work well.
Enjoy!
-Robert Chrystie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2016 10:23 PM
Hi Jenni,
You don't need to customize anything. You can continue to use cart_layouts. I am assuming you'll have two-step checkout = true.
Write an onSubmit client script on sc_cart table. When user clicks "Checkout" the system executes the onSubmit client script as usual on any form. Just have this code in your onSubmit client script.
function onSubmit() {
//Type appropriate comment here, and begin script below
if (g_form.getValue('special_instructions')=='') {
alert('Special instructions are required');
return false;
}else
return true;
}
This approach would be your best bet (no upgrade issues) but please be advised you need to customize the code to suit your needs.
P. S: Please like the answer/endorse if you had an impact to resolve your issue. It will help others to quickly find the solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-26-2016 03:35 AM