Populate Service Request fields with entries on the requested item
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Is it possible to populate a new service request with answers recorded on the associated requested item form?
My customer would like data from the RITM record to automatically populate the "Short description" and "Description" fields of the Request record . I was not sure if this is possible? Any suggesitons much appreciated
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
You can do it in two ways:
1. You can use Business Rule on sc_req_item table and update the REQ with the data from the RITM.
2. Use Catalog client Script onSubmit() and when the user submits the RITM, use GlideAJAX to change the fields of the REQ record.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
thanks Pau, I will take a look
best regards
Alison
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @AEC,
To automatically populate the "Short description" and "Description" fields on the Request record from the associated Requested Item (RITM) form, you can create an asynchronous Business Rule with the following details:
- Name: "Auto populate service request fields"
Table: Requested Item [sc_req_item]
Active: True (checked)
Advanced: True (checked)
Set "When to Run":
When: Async
Order: 100
Insert: True (checked)
- Filter Conditions: Item > is > {Select the Catalog Item where you want to apply this br}
In Script (Advanced Tab), add the following script:
(function executeRule(current, previous /*null when async*/ ) {
const VARIABLE_DESCRIBEYOURREQUEST = "8a698ecc8378b2104a38b8a6feaad3bb"; // the variable sys_id
var requestGR = current.request.getRefRecord();
requestGR.short_description = current.variables[VARIABLE_DESCRIBEYOURREQUEST];
requestGR.update();
})(current, previous);
Its better to save the constants on a separate script include. Its a best practice, not to hardcode sys_id on business rule.
Business Rule:
Request and Requested Item:
If my response helped, please mark it as the accepted solution so others can benefit as well.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi Muhammad, thanks so much for all the detail, I will give it a go and will certainly let you know how it goes,
best regards
Alison
