2) In the snippet code like so:
var field = arguments,
value = arguments,
$ = skuid.$;
// this should be your child relationship model
var yourModel = skuid.$M('YOURMODELNAME');
var yourFirstRow = yourModel.getFirstRow();
value = yourModel.getFieldValue(yourFirstRow,'c2g__Invoice__r.Name');
Instead of dragging a Child Relationship field into your table, just drag a plain old template component in there. For your template text, use...
I am trying to set a condition on the Child Relationship field. This is in addition to limiting the number of records to 1. My condition works if I set it by specifying a specific value for <= condition. But if I use this to compare against a field from a source model it does not work. Looks like the source model does not get evaluated in time. The same source model does return a record and I have verified that by just associating that field in a field editor. But the child condition does not work since source model apparently returns 0 records.
So, if I understand correctly, you have a parent model and child model, and the parent model has a condition where Id = the lookup field in any row returned by the child model. In your list of models, is the child model (the source model) listed before the parent model?
The only problem that remains is when I update the source model that provides rows for a condition in a chidlrelationship field in another model it does not automatically use the updated rows from the source model even when I query the model again using action framework.
Looks like the condition defined using “user rows from source
model” only sets it initially. If the source model changes it does not
update the condition. I could write a small java script code to force
that when my source model changes but I was assuming that requerying the model
would make sure that the conditions are also reevaluated using the updated
source or at least there is a way to force it in action framework.
May be you can consider it as an item for Action FW enhancement.
I think another one of our other customers just brought up a similar issue! It looks like this is a bug, and one of our product developers has looked into it. Requerying the model should definitely update the data to reflect the updated condition. One thing to note: If you don't need your model data directly on page load, I think the models may actually work correctly if you set "Load model data on page load" to false for these models, and then query them when you need them? Not ideal, but it might be a workaround for now. Thanks for reporting this!