Simple script to hide a Notification field based on another Field

Annette Kitzmil
Tera Guru

Hi All:

 

This is probably very simple, but I am jut not getting it right.  Basically, if the Account Type is Premium Savings as shown below, I don't want the "Requested Exception Term for Account field circled in red to show on the notification.  When the Account Type is not Premium Savings, I want it to show.  The script I have currently is shown below.  Can someone take a look and possibly reply back with the changes i need to make please?

 

AnnetteKitzmil_0-1710511225731.png

 

Current Script:

 

var reqTermForAccount = current.requested_exception_term_for_account;
    var remove = reqTermForAccount.remove("Requested Exception Term for Account:", "");
    var acctType = "Premium Savings";//if this acct type, we do NOT show the Req Exception Term for Acct
    if (acctType) {
        template.print('<b>Requested Exception Term for Account: </b> ' + remove.reqTermForAccount);
    }
    else;
 
 
Thanks,
9 REPLIES 9

swathisarang98
Giga Sage
Giga Sage

Hi @Annette Kitzmil 

 

 

 

var acctType = current.account_type;//here type the backend name of account type and fetch the value
    if (acctType != "Premium Savings") {
        template.print("Requested exception rate for account :  " + current.requested_exception_rate_for_account);
    }

 

 

 

use the above script but from body remove the ${requested_exception_rate_for_account} and in place of this call the mail script 

 

Please mark this comment as Correct Answer/Helpful if it helped you.

Regards,

Swathi Sarang

 

Hello,

 

So, something like this, the only thing is it says the months are undefined on the notification, so what am I missing here please?  Also, when I do have Premium Savings for the account type, I don't want this to show at all and it shows the same way as the screen shot below when the account type is Certificate of Deposit.

 

 

//var reqTermForAccount = current.requested_exception_term_for_account;
    //var remove = reqTermForAccount.remove("Requested Exception Term for Account:", "");
    var acctType = current.account_type;//
    if (acctType != "Premium Savings") {
        template.print('<p>Requested Exception Term for Account: </p> ' + current.requested_exception_term_for_account + 'months');
    }
    else;
 
AnnetteKitzmil_0-1710513542524.png

 

 
 

@Annette Kitzmil  did you remove ${requested_exception_rate_for_account}  ? and can you please show me how are you calling the mail_script please share some screen shot

 

Thanks 

Swathi

@Annette Kitzmil  and try replacing below

 

template.print('<p>Requested Exception Term for Account: </p> ' +current.getValue(requested_exception_term_for_account) + 'months');

 

Thanks 

Swathi