Ui action on one table should visible with respect to other table check box
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-22-2023 07:42 AM
Hi All
we have one ui action called View HTML on u_email_client table now this ui action button should be visible only when u_company_config_intg_ table u_html_email_content checked (true) for those companies only this ui action should be available how this can be done?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-22-2023 11:36 AM
Hi @jobin1,
Do you have a "company" field on the "u_email_client" table? ( a reference field to the Company table)
If yes, you can do the following
Create a new Script Include (navigate to System Definition > Script Includes)
You can try something like this for the script:
var uiActionUtils = Class.create();
uiActionUtils.prototype = Object.extendsObject(AbstractAjaxProcessor, {
type: 'uiActionUtils',
hideViewHtml: function(){
var checkbox = new GlideRecord('u_company_config_intg');// you'll need to do a Glide Record on your table
checkbox.addQuery('company',current.company); // look for the record that has the company selected in the u_email_client table, you should add instead of 'company; the name of the field in the ;u_company_config_intg; table and current.{the name of the field in the u_email_client table.}
checkbox.query(); // query
while(checkbox.next()){ // if you only have one you can use an if and if could have multiple you can use a while
if(checkbox.u_html_email_content==true){ //if the checkbox is true
return true; // return true ( will display the UI Action)
}
}
return false;// in any other scenario will not display the ui action
}
});
Now, in you UI Action you'll need the script to your condition:
If that helps please mark my answer as correct / helpful!
And if further help is needed please let me know
Cheers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-22-2023 11:13 PM - edited 11-23-2023 12:22 AM
HI Clara
I have only sys_domain in u_email_client table which will be same in u_company_config_intg
Javascript: new globaluiActionUtils().hideViewHtml()