Child Field Conditions: Field from another model - Error (no row in source model)

I have a query on Accounts that is returning a Child Relationship for Contact. The Conditions for my child relationship are checking if the Birthdate field is within a particular range based on the values of LowBirthdate and HighBirthdate in a UI only model (field from another model).

This conditioning wasn’t working and was just returning any birthdate.

I then set the condition to “Abort this Model’s Query” If no row in Source Model, and now the query doesn’t run, but there IS a row in the source model, and I’m also running this check via a subquery to only return accounts with contacts with a particular Birthdate range (field from another model) and that works just fine.

What’s going on here? Why does my conditioning for Field from another model see no rows in the Child Relationship, but in the main query’s subquery it’s picking up the row properly? This seems like a bug.


Subquery field from another model works fine:


Child relationship to Contact (in the same model) condition: Field from another model sees no row in source model?

Hi Mark,

Just waned to check if you are still in need of assistance with this issue? Were you able to resolve it? If not, we would like to know what version of skuid you are using and if this is an issue that used to work but no longer works. 

Additionally, how are your UI only fields set up regarding BirthDateHigh and BirthDateLow. Just wanted to see how you have it set up to see if the model with those UI only fields is querying before you query the model with the child relationship. 

I have not been able to resolve this issue unfortunately. My SKUID version appears to be 12.1.7

I don’t believe this ever worked; trying to get this to work just results in this error.

I have the UI only fields set up in a UI only model and are specified prior to running the query in the UI (field editor for this model, you enter the dates you’re looking to filter on, the model is initially loaded with a row in it, it is never saved). As I stated above, in the same query the subquery references these fields and works, whereas the Child conditioning references these fields and does not work, so it shouldn’t have anything to do with model loading order.

In a separate issue I was having I discovered that there were errors in SKUID when trying to compare UI only model date fields to Salesforce date fields; by using a real Salesforce object I created for the sole purpose of working with temporary variables for use with SKUID and comparing real Salesforce date to real Salesforce date I was able to get that condition logic working, but this seems to be a separate issue since it seems to be acting as if there’s no row in the source model when there definitely is a row in the source model. I haven’t yet tried to use my real Salesforce model here instead of the UI only model to see if that changes anything, but even if it does this very much seems like a bug. I’ll try that next.

I changed it over to using my Salesforce variable model instead of a UI only model and it still acts as if there is no row in the source model on the conditioning of the child relationship.

I’m also using the v1 API / editor

Hey Mark, 

Thanks for the additional information. Do you think you could possibly reproduce the issue by recreating a simplified version from scratch using only standard salesforce objects and fields and provide us with the xml for that so we can investigate the issue?

The following XML is a simplified page using only basic account and contact fields (specifically Birthdate on Contact) and a UI only model to specify the date range of birthdates.

While running this page, the sample Database should include accounts that have contacts underneath them with birthdates in the date range specified as well as contacts that have birthdates outside the date range specified. It should also include accounts that have contacts with birthdates only outside the birthdate range specified.

Running this you’ll see that it properly filters the accounts (via the subquery on contacts) to only show accounts that have contacts within the birthdate range, but you’ll also see that the Child relationship is not filtering children based on the birthdate range field from another model condition. If you change the child relationship conditioning (field from another model) to abort query if no row in source model, the query will be aborted and no rows returned.

XML:

{{RunQuery}} = 1 row.updated RunQuery Run Query Contacts {{Name}}: ({{Birthdate}})<br>


Hello Mark, 

Apologies for the delayed reply. Thank you for providing us with that xml. This does appear to be a bug and I will be sending this over to our engineering team for review. Thank you for bringing this to our attention. We will follow up should we discover a workaround. Otherwise we will update you once this has been fixed in a future release. 

Has there been any update on getting this bug resolved? I’m running into the same problem.

@Mark_L did you find a workaround for your scenario?

@Elena_ONeil I haven’t discovered any workarounds for this unfortunately.

I poked around the Community some more and found this post (http://community.skuid.com/discussion/comment/18273441#Comment_18273441) that offered a workaround using a snippet to update the value of the child relationship conditions.

skuid.model.getModel('modelName').fieldsMap.Child_Relationship__r.subConditions[subConditionIndex].value = singleValue; // sets the sub condition value if it's a single value condition
skuid.model.getModel('modelName').fieldsMap.Child_Relationship__r.subConditions[subConditionIndex].values = valueArray; // sets the sub condition value if it's a multi-value condition

As the original commenter notes, this is not supported functionality but it does the trick for my use case for now.