- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-01-2018 07:20 AM
Hi all,
in the normal view of a service catalog item, if you were to try executing g_form.getParameter("sysparm_item_guid") you would get the cart item id in advance before the item gets submitted.
Is there a way where i can get the cart item id of the item getting submitted in service portal?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2018 10:59 PM
Ahh, yes now I understand.
Unfortunately it is not possible in serviceportal. The serviceportal uses the cart API and therefore does not pre-generate any IDs as it just passes the catalog item details along when you add an item to the cart.
Maybe you can describe your business logic for this, and I might be able to give you some alternative suggestions?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-02-2018 01:02 AM
Hi
Yes you can use g_form.getSysId() instead
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-02-2018 10:16 AM
HI Lars,
Thanks for the reply but that is giving me the sys id of the catalog item which can be obtained by the getUniqueValue as well. In desktop, you can get the cart item id ahead of time.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-04-2018 10:42 PM
Ok, sorry I thought that was what you where after.
What do you mean about "cart item id" - which ID are we talking about here?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2018 07:31 AM
Hi Lars,
once we add an item to the cart it adds that record to the sc_cart_item table. On checkout we create the requested item. cart item id is the sys id of sc_cart_item record. In desktop, we can retrieve the sys id of the sc_cart_item even before it is inserted as it stored in the sysparm_item_guid. I was meaning to do the same in service portal as well as i wanted to dynamically edit the cart.