Before Query Business Rule on Parent Table Only
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-09-2012 10:41 PM
Question: Is it possible to write a "Before \ Query" Business Rule that does not run on a child table?
For instance, I want to create a new "u_incident2" table which extends the incident table and then write a Business Rule that will only run on the incident table and not the new extended table. Basically, I want to filter out the records in the u_incident2 table when looking at the incident table, but show them when viewing the u_incident2 table specifically.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-26-2012 06:01 PM
Hi Jim,
Once you create your extended table, does it show in the table listing in the Business Rule? If so select the table from there.
If not run a condition,
if (current.getTableName() === "YourExtendedTablename") {
//code here
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-27-2012 08:41 AM
One clarification regarding the user of getTableName() - the result can vary depending on the GlideRecord.
Say I have INC0010003, and I have an "incident" GlideRecord for that sys_id. getTableName() will give "incident". If, however, my GlideRecord is on "task" for that same record, getTableName() will give "task".
getRecordClassName(), on the other hand, will give "incident" for both. It returns the sys_class_name value. For conditions on class, it is often more reliable.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-17-2022 08:14 AM
try
current.addQuery('sys_class_name', current.getRecordClassName());}
:)...