I would like to change what fields are displayed on a presenation based on some of it's relationships. The article below talks about a function RelCount but it doesn't look like I can use it in field computations. The idea would be to create a boolean that checks if RelCount of a relationship is greater than 0. Then set this boolean to the Visible When property on the presentation.
Is there a way to achieve this functionality?
Thanks,
Nolin
Solved! Go to Solution.
HI Nolin,
If you just want to check whether there is any relationship at all, you can use the RelExists(<fieldname>) function
So the computation for a boolean "hasRelatedItems" field would be
RelExists(<your relationship fieldname>)?1:0
This makes the field's value TRUE if there is a realted Items.
Then you have to set the Relevance Rule for this boolean field, so that it is only shown if the value is TRUE.
Then you add the "hasRelatedItems" field to your item type, so you it calculated individually.
Next you edit you type's presentation template and selected the Grid you want to hide and set the "Visible When" property to the name of you boolean field "hasRelatedItems".
HTH Matthias
HI Nolin,
If you just want to check whether there is any relationship at all, you can use the RelExists(<fieldname>) function
So the computation for a boolean "hasRelatedItems" field would be
RelExists(<your relationship fieldname>)?1:0
This makes the field's value TRUE if there is a realted Items.
Then you have to set the Relevance Rule for this boolean field, so that it is only shown if the value is TRUE.
Then you add the "hasRelatedItems" field to your item type, so you it calculated individually.
Next you edit you type's presentation template and selected the Grid you want to hide and set the "Visible When" property to the name of you boolean field "hasRelatedItems".
HTH Matthias
Perfect! Thank you.
One delta. Instead of using the ?1:0, I just used RelExists() and that seems to return the appropriate value.