Skip to main content
1-Visitor
December 16, 2014
Solved

Dynamic Presentation Based on Relationships

  • December 16, 2014
  • 1 reply
  • 1641 views

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.

https://support.ptc.com/appserver/cs/view/solution.jsp?n=CS150440&posno=1&q=count relationships&nav=ptcproductgroups||integrity||Product+Group||integrity&source=Search

Is there a way to achieve this functionality?

Thanks,

Nolin

    Best answer by mrump

    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

    1 reply

    mrump16-PearlAnswer
    16-Pearl
    December 17, 2014

    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

    1-Visitor
    December 17, 2014

    Perfect! Thank you.