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 PTC Community Badges. Engage with PTC and see how many you can earn! X

Dynamic Presentation Based on Relationships

nborrerojr.
7-Bedrock

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

1 ACCEPTED SOLUTION

Accepted Solutions
mrump
14-Alexandrite
(To:nborrerojr.)

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
mrump
14-Alexandrite
(To:nborrerojr.)

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.

Top Tags