- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-22-2022 08:37 AM - edited 11-22-2022 08:44 AM
Hi
Trying to create RITM using inbound action and below cart API
target table: sc_req_item
createRequest();
function createRequest() {
var cartId = GlideGuid.generate(null);
var cart = new Cart(cartId);
//give sys_id of catalog item
var item = cart.addItem('0498ad2987472450d0d4ca27cebb35cc', 1);
cart.setVariable(item,"requested_for", gs.getUserID());
cart.setVariable(item,'short_description',email.subject);
cart.setVariable(item,'please_select_the_request','Active Directory');
var rc = cart.placeOrder();
var tsk = new GlideRecord('sc_task');
tsk.addQuery('request', rc.sys_id);
tsk.query();
while (tsk.next()) {
tsk.assignment_group = 'd625dccec0a8016700a222a0f7900d06' ;// add your value
tsk.short_description = email.subject;
tsk.description = email.body_text;
tsk.u_sub_category = 'Active Directory'; //add your value
}
}
but after using this the sys email table target record is getting updated and this error showing on the log
error
and 2 RITM's are getting created
why this is happening?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-30-2022 08:27 AM
I have configured Inbound action for Task table and everything works fine.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-23-2022 07:55 AM
use flow designer like I mentioned previously.
Or after you call your function createRequest();, try adding the line current.setAbortAction(true);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-23-2022 08:03 AM - edited 11-23-2022 08:12 AM
createRequest();
var cartId = GlideGuid.generate(null);
var cart = new Cart(cartId);
//give sys_id of catalog item
var item = cart.addItem('0498ad2987472450d0d4ca27cebb35cc');
cart.setVariable(item,"requested_for", gs.getUserID());
cart.setVariable(item,'short_description',email.subject);
cart.setVariable(item,'please_select_the_request','Active Directory');
var rc = cart.placeOrder();
current.setAbortAction(true);
is this fine?
didn't worked.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-23-2022 08:05 AM
should work, give it a try
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-23-2022 08:21 AM - edited 11-23-2022 08:43 AM
that didn't work, i mean worked as before only.
regarding flow designer when I tried the same
during submitting catalog item request action,
when I selected particular item and there is a sub question that needs to be selected (select the request type) but before selecting that type all the variables that doesnt belong to that selected request are getting displayed. why?
for ex:
Account catalog item
list of options under select the request type
1. AD (2 variables)
2. JDE (3 variables)
3. TCMIS (4 variables)
i have selected AD, it has to display only 2 variables but it is displaying 9 variables which includes JDE and TCMIS why?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-23-2022 08:59 AM
I don't think flow designer takes into account dependent fields/options (or client scripts) so that's why you see all the values. but since this is on the backend only it shouldn't be an issue.