Default dynamic logic of a custom field type

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Vincent
    Senior Member
    • May 2017
    • 176

    Default dynamic logic of a custom field type

    Hi, I am now working on a custom field type. Can i set the default dynamic logic of a custom field type? thanks.
  • telecastg
    Active Community Member
    • Jun 2018
    • 907

    #2
    Go to your entity's clientDefs metadata file and add the dynamic logic directives there.

    Dynamic Logic doesn't care what type of field you have, it just applies defined logic to make a field visible, not visible, read only, etc. You can use the following code as an example.

    In this case the field "tenantName" will be read only if the field "status" is either "Completed" or "Canceled"

    Code:
        "dynamicLogic": {
            "fields": {
                "tenantName": {
                    "readOnly": {
                        "conditionGroup": [
                            {
                                "type": "or",
                                "value": [
                                    {
                                        "type": "equals",
                                        "attribute": "status",
                                        "value": "Completed"
                                    },
                                    {
                                        "type": "equals",
                                        "attribute": "status",
                                        "value": "Canceled"
                                    }
                                ]
                            }
                        ]
                    }
                }
            }
        }

    Comment

    Working...