Field visibility by 2 tables condition
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-30-2024 03:15 AM
I have a custom table called "file_route" which has data direction field and a newly created field called security exception. I also have a other custom table called "domain" which has 2 fields which is a checked true/false fields called personal info, health info. Here I want to display security exception when data direction in file_route table is 'inbound' and either personal info or health info is checked.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-30-2024 06:24 AM
You can create a before or after insert/update business rule on the "file route" table. If needed any particular condition(data direction is inbound) then add it.
And in the script, check if current data direction is 'inbound' then Glide Record to check the domain table .
Add query to make relationship between two tables.
And final if and else block to check if "personal info" or "health info" is true and set the "security exception" field of current table to " true" if both checkbox checked otherwise false.
Thank you!!
Dnyaneshwaree Satpute
Tera Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-30-2024 06:41 AM
First i have make the security exception field as visibility false and then in a business rule this is the code i have tried but it didn't work -
if(data_direction == 'inbound'){
alert("hello");
var ddgr = new GlideRecord('x_data_domain');
//if(ddgr.get('sys_id', current.getValue('data_domain_name'))){
if(ddgr.get(current.data_domain_name)){
var piicheck = ddgr.getValue('personal_info');
var phicheck = ddgr.getValue('health_info');
//alert("world");
if(piicheck == true || phicheck == true){
g_form.setVisible('security_exception', true);
}
else
g_form.setVisible('security_exception', false);
}
}