- Post History
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
on 06-21-2022 11:15 PM
Auto-Populate "Contact Type" field to "Self-service" on REQ,RITM,SCTASK forms when a request is submitted from service portal.
note: All traces of service portal related requests and views are stored on sp_log table.
I have written a before insert Business Rule on sp_log table
There is this field "ID" it points to the Request number.
(function executeRule(current, previous /*null when async*/ ) {
var id = current.id;
var grREQ = new GlideRecord("sc_request");
grREQ.addQuery("sys_id", id);//
grREQ.query();
if (grREQ.next()) {
grREQ.contact_type = "self-service";
}
grREQ.update();
})(current, previous);
Note: we will only make these changes on REQ form and use the dot-walked field on RITM and SCTASK
- 1,893 Views
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Can you tell me How to Auto-Populate "Contact Type" field to "Self-service" on Incident form when an incident is submitted from self-service view ? can we use UI Policy for this ?
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
@Community Alums sure you can!
Have a look at this short tutorial on how to achieve this: https://www.youtube.com/watch?v=datpHpPj6bE&ab_channel=SAASWITHSERVICENOW
In your case, change the type of the Client Script to onSubmit instead of onLoad. And it should work.