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?
Solved! Go to Solution.
You could try using an advanced conditon to check against a trasnfered value.
Take a look at this link, might give you an idea of how to create a condtion based on the number of results returned:
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!
Thanks all, @JohanL's suggestion has acheive the result I need..
@s0m3one unfortunatley the results are coming from a 3rd party Web Service so a stored procedure is not the answer to this question.
You can use expressions for semi-colon delimited values in “Data Label” in my case as below:
If ( Length ( Data Label ) = 0, 0, Length ( Data Label ) - Length ( Replace ( Data Label, ;, (Empty String) ) ) + 1 )