In FMP I can count the records returned by a relationship prior to activating. Thus:
If (count(relationship) > 0 )
Go to Related Record, show
Go to Layout
Else
Do something else
End If
What coding strategy will produce a similar test in Servoy?
In FMP I can count the records returned by a relationship prior to activating. Thus:
If (count(relationship) > 0 )
Go to Related Record, show
Go to Layout
Else
Do something else
End If
What coding strategy will produce a similar test in Servoy?
With FMP it was always more efficient to test if there was any relational data there as a boolean result and then act upon it.
So I would do :
If (relationship::related field )
Go to Related Record, show
Go to Layout
Else
Do something else
End If
This would return a positive boolean result if there was data in the field (i.e. at least 1 related record existed) and act on it.
The act of asking FMP to count the records is more intensive than just assessing if there is related data.
The same test can be performed in Servoy :
If [relationship.relatedField}
{
do stuff via the relationship if there are record(s)
}
else
{
do stuff if there are no records
}
Harry
Harry, that’s TOO easy!
try this:
databasemanager.hasRecords(relation)