- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā06-30-2022 02:58 AM
Create a Business Rule which will trigger when new record will be inserted in Incident table then create a new record in Customer Incident table
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā07-01-2022 02:19 AM
Hi,
Why not use flow designer for this with no script?
try to use this script and share the update
(function executeRule(current, previous) {
var gr = new GlideRecord('u_customer_incidents');
gr.initialize();
gr.u_category = current.category;
gr.u_subcategory=current.subcategory;
gr.u_parent_inc=current.number;
gr.u_state=current.state;
gr.u_description=current.description;
gr.u_short_description=current.short_description;
gr.u_caller=current.caller;
gr.insert();
gs.addInfoMessage("The customer incident " + gr.getDisplayValue() +" has been created");
})(current, previous);
Regards
Ankur
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā06-30-2022 03:02 AM
Hello,
Here what is "Customer Incident table". Are you talking about any third party tool. If yes then it needs integration.
Regards,
Akshay
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā06-30-2022 03:04 AM
Hi Avinash
Can you explain in detail of your requirement?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā06-30-2022 04:03 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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā06-30-2022 06:22 AM
Hello
Create Business Rule on incident table. PFB screen shot.
then write script PFB sample script. Kindly add your customer table name and map all required fields as I have shown some examples
Sample script for easy copy paste -
(function executeRule(current, previous /*null when async*/) {
var gr = new GlideRecord('customer_incident'); //enter customer incident table name
gr.newRecord();
gr.category = current.category;
gr.state=current.state;
gr.description=current.description;
gr.short_description=current.short_description;
gr.parent_incident=current.number;
gr.caller=current.caller;
//similarly mapp all required fields.
gr.insert();
gs.addInfoMessage("The customer incident " + gr.number +" has been created");
})(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