How to grab the Number of the Record Using Business Rule
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-28-2017 04:10 AM
Dear All,
I am having problem in grabbing the Incident Number to the New Application I created.
Please see my script below, please let me know what needs to be done. Here is the scenario.
I have this Customer Service Module App. Once I submitted a record and it was identified as Incident, it will automatically create an Incident Record.
The problem is Is I need to grab the Incident Record number to the "Related Incident" reference field to serve as a reference. Please see screenshot.
Submit a customer service ticket.
Here is the Incident created
As you can see I make sure the customer reference number is available in the incident so that I will be able to query it using glide record.
Below is my script.
(function executeRule(current, previous /*null when async*/) {
// Add your code here
var gr = new GlideRecord('x_glti_incident_ma_incident_management_table');
//gr.addQuery('active','true');
gr.addQuery('u_customer_reference_no',current.sys_id);
gr.query();
if (gr.next()) {
current.related_incident.getValue(gr.sys_id);
gr.update();
}
})(current, previous);
- Labels:
-
Scripting and Coding
-
Team Development

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-28-2017 04:14 AM
Use this setValue instead of getValue
current.related_incident.setValue(gr.sys_id);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-28-2017 04:22 AM
Not working.
Mark Anthony Joson
Expert
EIG / Support Services / Project and System Maintenance
0917 588 9364 mrjoson@globe.com.ph <avillanueva@globe.com.ph>
2199090 https://business.globe.com.ph
<https://www.facebook.com/globebusiness>
<https://twitter.com/Globe_Business>
<https://www.linkedin.com/company/globe-business>
"GOOD GOVERNANCE and DOING THINGS RIGHT the FIRST TIME to AVOID WASTAGE to
multiply OPPORTUNITIES on our journey to service and operational EXCELLENCE
On Thu, Sep 28, 2017 at 7:14 PM, aakashshah <

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-28-2017 04:27 AM
var gr = new GlideRecord('x_glti_incident_ma_incident_management_table');
gr.addQuery('u_customer_reference_no',current.sys_id);
gr.query();
if (gr.next()) {
gs.log('sys id is'+gr.sys_id);
current.related_incident=gr.sys_id;
gr.setWorkflow(false);
gr.update();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-28-2017 04:37 AM
I think prior to my previous script, I did this one and is not working.
Mark Anthony Joson
Expert
EIG / Support Services / Project and System Maintenance
0917 588 9364 mrjoson@globe.com.ph <avillanueva@globe.com.ph>
2199090 https://business.globe.com.ph
<https://www.facebook.com/globebusiness>
<https://twitter.com/Globe_Business>
<https://www.linkedin.com/company/globe-business>
"GOOD GOVERNANCE and DOING THINGS RIGHT the FIRST TIME to AVOID WASTAGE to
multiply OPPORTUNITIES on our journey to service and operational EXCELLENCE
On Thu, Sep 28, 2017 at 7:28 PM, harshvardhansingh <