one filed on RITM Should be visible only while clicking on ui action button

jobin1
Tera Expert

Hi All,

I need to show one field called u_html_message on RITM  only when an ui cation called "View HTML" on RITM is clicked how can this be achieved so rest all the time u_html_message should be hidden

9 REPLIES 9

Hi Sandeep 

Let me try also i need to make this ui action "View HTML"visible only when the html field  check box checked on the u_email_client table how this can be done?

@jobin1 Hello jobin, just add a condition on the UI Action condition field current.u_html_checkbox==true. This will make the UI Action visible only when the checkbox is checked.

actually, ui action is on one table and this html check box is on another table so  its not working
like We have a ui action called "View HTML on u_email_client table " and this button should be visible only when the u_company_config_intg table entry for u_company" demo" inside that filed u_html_email_content is true how this validation can be done?

@jobin1 You can create a script include method which should return true/false depending up on the u_company_config_intg table entry for u_company" demo" inside that filed u_html_email_content is true/false.

 

This script include method can be called inside the condition field of the UI Action as follows

 

javascript&colon; new <script include name><method name>();

Hi Sandeep

tried the below script include and called in ui action but not working not even getting logs in script include.
//script include

var BPO_CSS_Di_Intergation_Company_validation = Class.create();
BPO_CSS_Di_Intergation_Company_validation.prototype = {
    initialize: function() {
    },
    //
validatecompany: function() {
    gs.log("cmpyval1");

                var ritmcompany;

                var ritmval = new GlideRecord('sc_req_item');
               ritmval.addQuery('sys_id', current.sys_id);
               ritmval.query();
                if (ritmval.next()) {
gs.log("cmpyval2");
                    ritmcompany = ritmval.company;
                    gs.log("ritmcompanyis"+ritmcompany);
                    var companyconfig = new GlideRecord('u_company_config_intg');
                    companyconfig.addQuery('u_company', ritmcompany);
                    companyconfig.addQuery('u_active', true);
                    companyconfig.addQuery('u_html_email_content', true);
                    companyconfig.query();
                    if (companyconfig.next()) {
                    return true;
                    }  
                }  
   
//
    type: 'BPO_CSS_Di_Intergation_Company_validation'
}
};

jobin1_0-1700663469959.png

 


//ui action
condition ->newBPO_CSS_Di_Intergation_Company_validation().validatecompany;

jobin1_1-1700663521938.png