The CreatorCon Call for Content is officially open! Get started here.

Conditions for reference tables for UI Actions

irfanshaik
Tera Contributor

Hello,

 

I am trying to apply condition on a UI action to show/hide the button. But the condition only works for default fields on the form and not for the fields that i've added by dot walking from reference tables

 

For instance, in this form, first_name is a field on the table where as vehicle_model is dot walked from another table - 

 

irfanshaik_0-1708305967664.png

 

This condition works well to show/hide the button -

 

irfanshaik_1-1708306022885.png

 

But this doesnt work - 

 

irfanshaik_2-1708306056956.png

 

I've tried doing 

 

current.getValue("vehicle_model") != 'Test';
current.getValue("case_id.product_features.vehicle_model") != 'Test';

 

1 ACCEPTED SOLUTION

Nice, then you can change the condition of the UI Action to this:

current.case_id.product_features.vehicle_model.getDisplayValue()  != 'Test';

 

Let me know if it works!

View solution in original post

11 REPLIES 11

FYI, you can check the log created by gs.info in the System Log [syslog] table.

 

Let's try one at a time and see where it's going wrong.

gs.addInfoMessage('Case: ' + current.case_id.getDisplayValue());
gs.addInfoMessage('Product feature ' + current.case_id.product_features.getDisplayValue());

 

Thanks

ok, these two lines - 

irfanshaik_0-1708312137061.png

 

give me -

irfanshaik_1-1708312175981.png


Thanks!

and this - 

gs.addInfoMessage('Case: ' + current.case_id.getDisplayValue());
gs.addInfoMessage('Product feature ' + current.case_id.product_features.vehicle_model.getDisplayValue());

 

gives me -

irfanshaik_2-1708312326882.png

 

which is the correct value of Vehicle Model in the form

Nice, then you can change the condition of the UI Action to this:

current.case_id.product_features.vehicle_model.getDisplayValue()  != 'Test';

 

Let me know if it works!

Yes, that worked.

 

So the issue was that i was using -

 

current.getValue("case_id.product_features.vehicle_model") != 'Test';

 

 

instead of - 

 

current.case_id.product_features.vehicle_model.getDisplayValue()  != 'Test';


Appreciate you helping me through this!