- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-30-2022 02:57 AM
Create a Business Rule which will trigger when record is updated in Incident table then update a record in Customer Incident table with updated field
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-30-2022 06:34 AM
Hello
Seems you have pasted same requirement of insert business rule (your another question).
What I understood, you need to update customer table incident if regular incident updates.
You need to create After business rule runs on "Update" only. Add filter conditions as which fields going to update. For example, state changes then triggers the business rule.
Script -
(function executeRule(current, previous /*null when async*/) {
var gr = new GlideRecord('customer_incident'); //enter customer incident table name
gr.addQuery('parent_incident', current.sys_id);
gr.query();
if (gr.next()) {
gr.state=current.state;
//similarly mapp all required fields.
gr.update();
}
gs.addInfoMessage("The customer incident " + gr.number +" has been updated");
})(current, previous);
Mark ✅ Correct if this solves your issue and also mark ???? Helpful if you find my response worthy based on the impact.
Thanks
Akshay Kangankar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-30-2022 04:16 AM
Customer Incident Table:
Table Name - Customer Incidents
Fields -
Inc Number - autogenrated number
Parent Inc Number- number
Short Description - String 250 Mandatory
Description - HTML Mandatory
State - Choice (values same as incident State field values)
Category - Choice ( Same as Incident Category field values)
Subcategory - Choice ( Same as Incident Category field values)
Caller - Reference ( ref to sys_user table filter only active records)
Assignment Group - Reference - (ref to sys_user_group table)
Assigned to - reference - (ref to sys_user table)
Additional Comments - Journal input ( same as incident)
work notes - Journal input
Detail statement :
Create a Business Rule which will trigger when new record will be inserted in Incident table then create a new record in Cusetomer Incident table with below values
Parent Inc Number, Short Description, Description, State, Category, Subcategory, caller
*Inc Number should be autogenerated.
Once record is inserted show info message on form with new Inc number which will be created on Customer Incident table.