UI Action Copy button
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-07-2023 11:32 PM - edited ‎09-24-2023 10:44 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-08-2023 12:57 AM
when you copy REQ it's not copying RITM as well?
Did you check that?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-08-2023 01:00 AM
@Ankur Bawiskar , yes it's coping RITM also, but it's create a new request number, they don't want like that we need copy only RITM with same request number.
Thanks,
Deepika
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-08-2023 01:07 AM
So it's like need to create child RITM.
Thanks,
Deepika
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-08-2023 01:51 AM
then use Cart API and it will create fresh REQ and RITM.
Delete the newly created REQ and update the earlier REQ in the newly created RITM
Sample script
try{
var cartId = GlideGuid.generate(null);
var cart = new Cart(cartId);
//add your requested item to the cart by sys_id of the catalog item
var item = cart.addItem('0336c34407d0d010540bf2508c1ed096', 1);
//fill in the variables on the request item form
cart.setVariable(item, "asset", "00a96c0d3790200044e0bfc8bcbe5dc3");
cart.setVariable(item, "multiple_choice", "Phoenix");
var rc = cart.placeOrder();
gs.info(rc.number);
}
catch(ex){
gs.info(ex);
}
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-08-2023 03:21 AM
Hi @Ankur Bawiskar ,
Actually the above script is oki, my point is like , when we create a request then we can see copy button is ootb. but I need to create same type of button in RITM. when when click that it's create a new RITM with different number but same request number.
Thanks,
Deepika