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

Conditionally Required Attribute on CR in Windchill

rhermann
12-Amethyst

Conditionally Required Attribute on CR in Windchill

Is there a way to make an attribute conditionally required on the creation of a Change Request? Example: if Attribute 1 is set to TRUE Attribute 2 is now required. If Attribute 1 is set to FALSE Attribute 2 is grayed out.

ACCEPTED SOLUTION

Accepted Solutions
rhermann
12-Amethyst
(To:rhermann)

Here is the solution:

  1. In the type and attribute administration edit the object type and click on the downstream attribute (attribute 2 in this use case)
  2. Add a “Required” Constraint to the downstream attribute (In this use case Attribute 2)
  3. Next to the constraint there is a link to “Add Conditions”  click on it
  4. Click on the green plus sign in the popup window to add a condition
  5. For the driver attribute choose the upstream attribute from the list (in this use case Attribute 1)
  6. For rule choose Legal Value List
  7. In “Enter Data” type in the trigger (In this Use Case “True”)
  8. Click OK
  9. Click OK
  10. Save

View solution in original post

6 REPLIES 6
rhermann
12-Amethyst
(To:rhermann)

Here is the solution:

  1. In the type and attribute administration edit the object type and click on the downstream attribute (attribute 2 in this use case)
  2. Add a “Required” Constraint to the downstream attribute (In this use case Attribute 2)
  3. Next to the constraint there is a link to “Add Conditions”  click on it
  4. Click on the green plus sign in the popup window to add a condition
  5. For the driver attribute choose the upstream attribute from the list (in this use case Attribute 1)
  6. For rule choose Legal Value List
  7. In “Enter Data” type in the trigger (In this Use Case “True”)
  8. Click OK
  9. Click OK
  10. Save
lgrant
15-Moonstone
(To:rhermann)

Do we need to add the second attribute into the layout?

rhermann
12-Amethyst
(To:lgrant)

If one attribute is being set by a user and driving another attribute during creation of an object you would at least want to have them both in the "create new" layout and possibly also in the "edit" layout.  It would then be up to you if you wanted these attributes and the metadata stored in them to be able to be seen by users on the details page for instance.  If you do then you would want to add the attributes to the additional appropriate layouts.

Hope that helps...

-Ryan

lgrant
15-Moonstone
(To:rhermann)

I'm just starting to test on 11 and not having much luck.

This is on the CR "Set Attributes" page. I have a Global Attribute called "Validation Required" with a Enumerated Value List of Yes, No.

Then in a second attribute called "Validation Type" that is Required also, the Required has a Conditional of upstream "Validation Required" = Yes then Validation Type, Required.

Validaton Type.jpg

This is how it is displaying:

CR.jpg

rhermann
12-Amethyst
(To:lgrant)

Why would you use a string datatype for a Yes/No?  Seems like you should have created a Boolean attribute which has a default choice of Yes/No.  Typically when creating attributes I would create a "Reusable Attribute" then go to the CR create a new attribute and create a global (reusable) attribute and choose the one you created.  In this case when you create the Reusable attribute create it as type boolean.

Then your setup of conditions seems to be correct.  probably will have to update it to point to the correct attribute once you recreate it as the correct data type.

lgrant
15-Moonstone
(To:rhermann)

Still not working. Is there a link to PTC guidance on this?

Conditions are not currently reflected in the end-user user interface. Therefore, even if you set up conditions in the Type and Attribute Management utility, they have no effect on the end-user user interface. Enhancements are planned to close this gap in a future Windchill release.

Announcements


Top Tags