Hello -
I have a model that is marked as “Create Default Row if Model Has None” and has a condition applied to a reference/lookup field. When the condition fails, a new row is created in the model and it contains the object id for the field where the condition is set. So far so good…
The problem that I am having is that I need properties of the reference field in order to conditionally render certain portions of the screen. When the record already exists, the appropriate fields get pulled down for the reference field and conditional rendering works as expected.
Unfortunately, when a new row is created in the model, the additional properties of the reference field are not retrieved on page load so my conditional rendering does not work properly.
Here is sample:
System Model has property Color
Order Model has property System (reference to System Object)
When Order already exists, Color is available via OrderModel.System__r.Color
When Order is a new record, OrderModel.System__c gets the right value based on the condition but OrderModel.System__r.Color is not retrieved from server. I did specify Color is a retrieved field on System Model and on Order Model.
What I have tried so far:
1) Setting field.options.returnFields but this doesn’t seem to work on initial page load. Only seems to work when value in the conditioned field subsequently changes.
2) Creating a condition on OrderModel.System__r.Color_c setting it to SystemModel.Color__c but skuid seems to never set “__r.XXX” fields programmatically or in conditions.
This is a blocking issue for us currently so appreciate a quick response on this one.
Thank you!
Question
Default value for reference field based on condition
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.
