- Post History
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
on 07-18-2021 10:03 AM
Hi Community,
While working in Domain Separated environment, requirement might comes up as to apply data segregation to an existing table or a newly created custom table.
This article explains the detail implementation of the data segregation on custom table.
"Domain separation plugin" is activated and data segregation is already in place.
1. Ensure we have a reference of the table on which the data segregation has been setup in the organization.
Example: Lets assume core_company, so we should have a reference of core_company table either directly on the custom table or we can get it from a parent record.
2. Create Domain field on custom table. Please find the detailed instruction on the docs page.
3. Create Business Rule to populate the sys_domain field on custom table based on the core_company table.
Use Before : Insert and Update Business Rule on the custom table.
Condition: current.u_company.changes() && !current.u_company.nil()
Script:
(function executeRule(current, previous /*null when async*/) {
current.sys_domain = current.u_company.sys_domain();
})(current,previous);
Note: Mark Helpful, Bookmark the Article and do share with your colleagues.