- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-27-2018 01:12 PM
I am looking into adding a confirm() dialogue when the 'Approve' action is selected on an approval. My goal is to verify that the approver is aware of the costs that are associated with a specific item. Due to the inconsistency of price for the catalog item, it is not including on the item and appears to be cost free when viewing the cart.
I'm curious if anybody has a better suggestion rather than having a confirm pop-up added to the approve UI action. This seems clunky to me and if a similar issue is come across in the future, having a spam of pop-ups seems like bad practice.
If anybody has run into a similar issue or has any suggestions, all input is appreciated.
Regards,
Ryan
Solved! Go to Solution.
- Labels:
-
Best Practices
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-28-2018 09:33 AM
Adding it to the approval action is really the only way to go. Although I would suggest cloning the out of the box UI action first, inactivate the OOB one, and then update your clone of it. This way you won't have upgrade issues to deal with.
In regards to making this easy to maintain the UI action, is it just 1 item or could it be multiple over time? If multiple, you could create an attribute on the catalog item table to designate it requires confirmation and use it when you are querying the sc_req_item table looking to see if its associated item is designated for confirmation. Otherwise yes you will be querying sc_req_item where item = SysID
Since confirm() is client side and you need to query server side for the records, its best to do this with a display business rule that will pass a flag to the client script to confirm. Here is more details on display business rules:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-27-2018 01:16 PM
Hi Ryan,
If you are using a Catalog Item, it means you can provide a variable for the cost in your RITM ticket. The user will receive the approval notification for the RITM ticket and they should be able to see the variable field with the cost. Then, they can approve or reject based on that information.
I hope this helps,
Pedro Lopez
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-27-2018 01:53 PM
Thanks for the quick response Pedro.
Apologies for not being more specific. I am using a catalog item but am unable to put a value in the cost field. The price is dependent on status, role, title, and location of the Requested for. The manager (who is the approver) has the ability to obtain the price by looking at the dependent attributes.
The group that owns the catalog item wants there to be some sort of sign-off to confirm that they have made themselves aware of the price before they approve the request.
Unfortunately the price field is not a viable option at this point in time.
Regards,
Ryan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-27-2018 02:02 PM
Hi Ryan,
This sounds like you need to add an script in your catalog item. If the price is dependent on status, role, title, and location of the Requested for. Once the Requested for is provided, you will need to run an script to get the price and add it to the price field. You will need to create a price field too.
I hope this logic works for you,
Pedro Lopez
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-27-2018 02:02 PM
You may find this SNGuru post helpful with examples about creating a confirm dialog box via a client script. Just keep in mind that approvals via email won't invoke this code since there is no way to do that via email.
https://www.servicenowguru.com/scripting/client-scripts-scripting/javascript-popup-boxes-servicenow/