- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-14-2016 04:02 AM
Hi All,
I have two tables, Exception and Service Request. I have written a Business Rules that update the exception id and exception status in the incident table. Basis on the reference number.
This BR works only when I have exception created first and Service Request created next for the same reference number/SR ID. But It does not work when it is vice versa. I want it to work on both the cases.
Below are the screenshot and scripts for your reference.
Service Request (Exception ID and Exception Status) gets auto update basis on BR
Exception Table (Reference Number is looked in this table) if it is a match then it gets populated in the Service Request table.
Script
(function executeRule(current, previous /*null when async*/) {
var extracting = new GlideRecord('x_isgi_isg_governa_isg_pm_sla_exception');
extracting.addQuery('reference_number',current.sr_id);
extracting.addQuery('service_month',current.service_month);
extracting.query();
if(extracting.next()){
current.excep_id = extracting.sys_id;
current.excep_status = extracting.status;
}
//current.update();
})(current, previous);
Appreciate your input and early response.
Regards,
Narmi
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-14-2016 04:35 AM
A business rule is per table, do you have 2 BRs , one for each table?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-14-2016 04:35 AM
A business rule is per table, do you have 2 BRs , one for each table?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-14-2016 09:56 PM
Hi Sergiu,
I have one BR in Service Request Table. I do not have any BR in Exception Table from where the lookup is happening into the Service Request Table.
Exception Table is a single source which I am trying to connect to all other tables that I have.
In all the below tables I have written BR to update exception if any tracked.
In ideal scenario user raises an exception anytime during the month and at the end of month user submits below tables with data filled in it. While validating the data if there are any misses those missing would have received an exception. Therefore It auto pics feeds from exception table.
In other cases if user has submitted the data filled tables (any below tables) then raises an exception for the miss. The exception approved/rejected does not get updated in the data tables (any tables from below). This is what my BR currently not doing.
Incident |
Service Request |
Change |
Problem |
Availability Details |
Batch Analysis |
Backup |
Availability Check |
Forecast |
Rework |
Service Desk |
File Restoration |
RCA |
Asset Inventory |
Project Delivery |
Reporting |
Patching |
Staffing |
Defect-Backlog |
Supplier Personnel |
SOW |
Thanks for your response.
Regards,
Narmi