Display the Ui action button based on the condition

vinod6
Tera Contributor

 if the type if Desktop or Printer then add a button on top of task "TO"
when clicked on TO it initiates the transfer order process.

Please correct the above below script.

 

vinod6_0-1730710365226.png

 

 

if (current.type == 'desktop' || current.type == 'printer') {
action.setVisible(true); // Show the button
} else {
action.setVisible(false); // Hide the button
}
var url = "https://dev.service-now.com/now/nav/ui/classic/params/target/sn_hamp_loaner_asset_order_list.do?sysp...";

action.setRedirectURL(url);

 

1 REPLY 1

Shruti
Mega Sage
Mega Sage

Put this current.type == 'desktop' || current.type == 'printer' in condition section instead of script section

In script section, use only redirect URL

var url = "https://dev.service-now.com/now/nav/ui/classic/params/target/sn_hamp_loaner_asset_order_list.do?sysp...";

action.setRedirectURL(url);

 

Shruti_0-1730710714898.png