- Post History
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
on ‎10-10-2021 06:42 AM
One request that I heard multiple times is the possibility of saving multiple "wish list" items for the same catalog item. Today, in ServiceNow out of the box (at least in Rome) you can only save one.
If you google a little bit there are a few suggestions in how to accomplish that:
https://www.dylanlindgren.com/2021/09/24/save-as-draft-record-producers-in-service-portal/
Also, there are two ideas in the Idea portal requesting this improvement for ServiceNow. If you have a chance, I suggest you vote on this one.
I decided to investigate how things works and the OOB scenario is:
- Once you Save it as wish list item the system creates a record in the sc_cart_item table;
- The record created has a Cart name. For all wish list items, the cart name is always saved_items;
- The record also has an Item column that represents our catalog item
All the code in the widgets SC Wish List Cart, SC Catalog Item, and in the REST Resources Submit a Record Producer and Add item to wishlist has the saved_items name hardcoded.
If instead of hard coding the name "saved_items", we create a unique cart name each time the user wants a new draft instance, it can solve our problem!!
I duplicated all the widgets/REST resources mentioned and performed the adjustments to handle at least multiple wish list items (that now I'm calling Draft List items) created by record producers.
I keep things in the same application scope (global in global, sn_sc in sn_sc) to avoid changing any permission. The "only" permission changed was in the sc_cart_item table allowing deletions triggered from other application scopes.
I attached the XML updateset to this article. I didn't load it in any instance (just exported from my dev one). If something is missing, just let me know.
For testing, after importing to your instance:
- Edit the page sc_cat_item and replace the OOB widget SC Catalog Item with the Custom SC Catalog Item with Draft
- Edit the page sc_wishlist and replace the OOB widget SC Wish List Cart with the Custom SC Draft List Cart
The version made so far only works for catalog items that are record producers. I didn't make the adjustments for all types of catalog items. I also didn't test in mobile.
I really appreciate any feedback and feel free to share your idea on how to achieve this business need!
- 2,843 Views
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Hi I tried merging in your update set
When I place the custom SC draft list cart into my sc_wishlist I get a template error
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
If you scroll down to the related list for "Angular ng-templates", open the custom_draft.html template. Copy the contents of the template and replace the "Body HTML template" field on the "Custom SC Draft List Cart" widget with what you copied. This should fix the error.
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Hi, We have made use of this and have an issue where an attachment added to one instance of draft is linked to all instance of the draft. Has anyone faced this issue before?