Skip to main content
1-Visitor
November 5, 2013
Question

Mandatory fields when certain conditions are met

  • November 5, 2013
  • 1 reply
  • 4294 views

I know the best way to make a field mandatory when certain conditions are met is to use a pre-event trigger. However, my dilemma lies that I have mandatory fields in the same state, in two tabs, and one is hidden (due to an earlier mandatory field in a state). Now, I do not want the fields that are mandatory on the hidden tab to be mandatory anymore because a different condition was met. Is the best way to run multiple pre-event triggers to make the fields mandatory instead of making them mandatory in the workflow? Also, what order are the pre-event triggers executed?

    1 reply

    1-Visitor
    November 5, 2013

    I should also mention some fields are relationship fields that need to contain at least one related item.

    1-Visitor
    November 6, 2013

    Hi Anthony,

    Depending on your Integrity version, you might want to take a look at the "Constraints" functionality. While it is not as powerful as a pre-event trigger (where you can check group membership, fire on specific state or field transitions, check the field values on items on the other side of relationship fields, etc), it does allow you to make fields mandatory based on the field values currently selected in the item, not just the state workflow.

    This has allowed us to remove multiple triggers (which merely fired an abort if the rule was matched) and consolidate our mandatory fields logic to make it easier to maintain. It also makes the field labels turn red and show up in the "mandatory fields" hover in the corner of the item, which is appreciated by our users.

    I can't seem to find a reference for how it works in the knowledgebase, but if you look at the "Managing Constraints" section (under Item Type Attributes) in the Server Administration Guide, it goes over how the constraint functionality works and how you implement constraints on your item. Your use case sounds like you are looking for a "rule" constraint.

    Hope that helps,

    Matt

    1-Visitor
    November 6, 2013

    Matt, I am currently using 2009, unfortunately I do not have the ability to setup constraints.