Can we use CART API for Record Producers?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-26-2019 05:06 AM
I want to use CART API to submit a record producer, Is Cart API only available for Catalog Items?
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-26-2019 05:17 AM
No , you can not.
you can use rest API here and then service catalog API
HI article for further details.
https://hi.service-now.com/kb_view.do?sysparm_article=KB0686272

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-26-2019 05:36 AM
Hey
Thanks for responding!!
If not CART API, what else I can use to make it look like that the records are created from Portal?
Say, I am doing POST Call from POSTMAN, but record being created should look like its created from Record Producer, Any way I can achieve that.
I am willing to explain my full business use-case if required.
Thanks.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-27-2019 12:22 AM
yes you can achieve it .
i am assuming here you just need to know if the record producer has been submitted from portal or not. here we will use sp_log table.
if yes follow the below step.
Create one event here
Go to module system policy >> Events >> registry.
Screenshot for reference.
Now create one script Action:
Go to module system policy >> Events >> Script Actions
var ID = event.parm1;
var grsp = new GlideRecord('sp_log');
grsp.addEncodedQuery('type=Task View^id='+ID);
grsp.query();
if(grsp.getRowCount() >0){
var gr = new GlideRecord('incident');
gr.get(ID);
gr.work_notes = 'Record as been created from portal RP';
gr.update();
}
Now create one before business rule on incident table to trigger the eventQueueScheduled().
(function executeRule(current, previous /*null when async*/) {
// Add your code here
var gdt = new GlideDateTime();
gdt.addSeconds(4);
gs.eventQueueScheduled('rp.portal',current,current.sys_id,'Scheduled ' + gdt.getDisplayValue(),gdt);
})(current, previous);
Note: Now whenever you will submit the record producer from portal, incident work notes will get updated . you can set the field value as well eg: contact type as service-portal .
Hope it will help you.
If my answered helped you , kindly mark it as correct and helpful.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-28-2019 09:45 AM
That was very interesting Harsh, but that is not what I am after. I want something for record producer what CART API does.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-28-2019 09:47 AM
CART API wont work for record producer.
what is your business need?