cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X

Dynamic Presentation Based on Relationships

nborrerojr.
12-Amethyst

Dynamic Presentation Based on Relationships

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

ACCEPTED SOLUTION

Accepted Solutions

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

View solution in original post

3 REPLIES 3

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

nborrerojr.
12-Amethyst
(To:mrump)

Perfect! Thank you.

nborrerojr.
12-Amethyst
(To:mrump)

One delta. Instead of using the ?1:0, I just used RelExists() and that seems to return the appropriate value.

Announcements


Top Tags