How to make a field required based on another field’s value

Hi,

I have P2 attribute for a Part class which is required only when there is another P2 attribute set to Yes? I would need this when creating the part and redlining it.

Any suggestions on the approach?

Thanks.

Add Comment
3 Answer(s)

It cannot be set as mandatory during creation/save as but you can configure this requirement as workflow configuration.
Creating a critetia Where p2.fieldname equal to ‘Yes’, you can use it in a workflow status criteria.
After that, you can set the other field as exit required field of this Status Criteria. User cannot move forward the wf if second field is empty.

Agile Angel Answered on March 7, 2016.

Is there any API that I can use?

on March 7, 2016.
Add Comment

You can achieve this by creating a new workflow status criteria for “affected items where [ P2 attribute] = ‘Yes'” – then set the 2nd field as exit required for that specific status criteria only.

Agile Angel Answered on March 7, 2016.
Add Comment

Thanks but the requirement needed to be triggered during part creation or Save As. So I figured out to make a field behave like a required is to check the field has been updated using the getDirtyAttrValue() .

Agile Angel Answered on March 7, 2016.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.