Is anyone able to provide guidance on how to make the businessDefintion a required field when creating new terms?
Is anyone able to provide guidance on how to make the businessDefintion a required field when creating new terms?
Hi
If you would like to make a attribute mandatory, inside of the Metadata Model you can set the flag for ‘Required’ to be on.
See screenshot attached.
You can find this in Metadata Model → Term(Or any entity you want to customize)
Hi
{
name: "Make businessDefinition property mandatory",
description: "Sets property businessDefinition of node term as required",
operations: t
{
name: "AddConstraint",
args: {
targetNode: "term",
targetProperty: "businessDefinition",
constraint: {
id: "DEFINITION_REQUIRED",
type: "REQUIRED"
}
}
}
]
}
You will save this as a json5 file and upload it through System changes: https://docs.ataccama.com/one/latest/metadata-model/system-changes.html#add-changes.
However, this will cause that all your existing terms, that won’t have the business definition filled, will become invalid (you will see an error in each of them). So I highly recommend to populate the field everywhere before uploading this. Also, it is recommended to do a DB backup before performing such change. For that reason it is much safer to create a new field as Robert described.
You can use a similar command to remove the constraint as well:
{
name: "Remove required constraint from terms",
description: "",
operations: p
{
name: "RemoveConstraint",
args: {
targetNode: "term",
targetProperty: "businessDefinition",
"constraintId": "DEFINITION_REQUIRED"
}
}
]
}
Kind regards,
Anna
Hi
No account yet? Create an account
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.