Custom field value "Not valid" error message

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jtubee
    Junior Member
    • Jun 2024
    • 21

    Custom field value "Not valid" error message

    Hello,

    I set up a "Conditions that make the field invalid" rule on a field, but I need to show what is the reason why the reported value is invalid instead of the default "Not valid" message since the value of this field will only be valid depending on the value of another field of the same entity.

    Is this possible?

    In the meantime, I created a tip text in the field...

    Thank you​​
  • rabii
    Active Community Member
    • Jun 2016
    • 1250

    #2
    You can use API beforeSave formula something as below (don't use both condition and formula, just use formula)

    PHP Code:
    // e.g here you can check the condition and through an error if the value of the field is not valid.
    if (status == 'Completed' && !dateCompleted) {
        recordService\throwBadRequest("Missing `dateCompleted` value.");
    }
    Rabii
    Web Dev

    Comment

    Working...