- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-18-2024 05:29 PM
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 -
This condition works well to show/hide the button -
But this doesnt work -
I've tried doing
current.getValue("vehicle_model") != 'Test';
current.getValue("case_id.product_features.vehicle_model") != 'Test';
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-18-2024 07:14 PM
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!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-18-2024 05:40 PM
Hi @irfanshaik,
You should be able to use the dot-walked field for your UI condition.
Are you sure you are using the correct field names?
Also, have you tried debugging via printing logs?
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-18-2024 05:50 PM
I think i am using the right field names. These are the details -
first_name -
vehicle_model -
can you tell me how to debug via printing logs please ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-18-2024 05:58 PM
Can you verify the type of 'vehicle_model' field? Is it a reference field? If so, you would need to dot-walk once more. e.g.
current.getValue("case_id.product_features.vehicle_model.name") != 'Test';
Otherwise, try printing out some logs from the Script section of the UI Action.
Something like:
gs.info("Value of vehicle_model is " + current.getValue("vehicle_model") );
gs.info("Value of case_id.product_features.vehicle_model is " + current.getValue("case_id.product_features.vehicle_model") );
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-18-2024 06:56 PM - edited 02-18-2024 06:58 PM
Vehicle Model is just a string type field in the table Product Features
gs.info didnt work for me or current.getReference("vehicle_model").getDisplayValue();
but gs.addInfoMessage worked -
gs.addInfoMessage('First Name: ' + current.getValue('first_name'));
gs.addInfoMessage('Vehicle Model: ' + current.getValue('vehicle_model'));
gs.addInfoMessage('Vehicle Model Dot Walked value: ' + current.getValue('case_id.product_features.vehicle_model'));
This gives me -
It confirms that there is some issue with the full field name - case_id.product_features.vehicle_model as its not able to fetch the value
Just not sure what the issue is. This is the schema map -
You go from Case Id to Product Features to Vehicle Model