Join us Dec. 16 for The Community Hour, our first global virtual User Group event!

Client script is working in native view but not working in HAM workspace view

vyeturi
Tera Contributor

for this condition= Hide 'yes - rma not required' choice option on under warranty field, if Troubleshoot result = unrepairable

for this scenario we use this code in on change client script
its working native view but not working in workspace view 

function onChange(control, oldValue, newValue, isLoading, isTemplate) {
    if (isLoading || newValue === '') {
        return;
    }
    var warrantyField = 'u_under_warranty';
    var rmaValue = 'yes - rma not required';

    if (newValue == 'unrepairable') {
        g_form.removeOption(warrantyField, rmaValue);
    } else if (newValue == 'repairable') {
        if (!g_form.getOption(warrantyField, rmaValue)) {
            g_form.addOption(warrantyField, rmaValue, 'Yes RMA Not Required', 1);
        }
    }
}

could you please suggest any recommendation on this then it would be helpful

Regards
Venkatesh

 

3 REPLIES 3

yashkamde
Tera Sage

Hello @vyeturi ,

 

Plz ensure that Clients scripts are set to UI Type = All :

How to configure a client script to run in both platform UI and Workspace 

 

If my response helped mark as helpful and accept the solution.

Ankur Bawiskar
Tera Patron

@vyeturi 

is your client script with UI Type = ALL?

I think this method might not be working in workspace

g_form.getOption(warrantyField, rmaValue)

Did you add alert and see and debug?

💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏

Aditya_hublikar
Tera Sage

Hello @vyeturi ,

 

Please check its UI type = All .