I have been asked if is possble to conditionaly perform an action depending on the number of results returned after executing a smart object. i.e if one result transfer values to controls ELSE display a subform with all results.
Obviously to do this need be able to count the number of items returned from the smart object.I cannot see any native way to do this so i've started to look for work arounds.
I've looked at creating an expression and using the List Affregators - List Count operator. This worked on a List view but not on an item view. I have tried using this expression against a drop-down-list data source but it hasn't worked.
Is anyone able to assit, or should I abandon all hope?
Best answer by JohanL
One way to do this is to create a list view which displays your list and then have a list aggregator count the results.
Set it to asynchronously execute the GetList method.
Then in the form where you want to use the count, add this view but hide it and then in your rules you will have access to the controls on this hidden view and so also the count value. You can then use this in an expression.
Hope this helps!