My custom field is crossed out in payload fields in Lead Capture

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nocstaff@urbancom.net
    Junior Member
    • Jul 2025
    • 17

    #1

    My custom field is crossed out in payload fields in Lead Capture

    I made a custom smsOptIn field for the Lead entity and added it to the Payload Fields section in Lead Capture, however once I save the new Lead Capture for my SMS Opt-In Form, it gets crossed out in the list. The field itself is a boolean meant to keep track of who is opted in and out. Why is this happening and how do I fix this?
    Attached Files
  • yuri
    Member
    • Mar 2014
    • 9179

    #2
    Quick fix. Create custom/Espo/Custom/Resources/metadata/entityDefs/LeadCapture.json

    Code:
    {
        "fields": {
            "fieldList": {
                "webFormFieldTypeList": [
                     "__APPEND__",
                     "bool"
                 ]
            }
        }
    }
    Then, clear cache.
    If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

    Comment

    • nocstaff@urbancom.net
      Junior Member
      • Jul 2025
      • 17

      #3
      This works, thank you. I have another question I would like to ask. Do you know how to require this checkbox to be selected? I want users to be unable to fully submit the form until they agree to receive sms messages, otherwise the form itself is redundant. Do you know how to implement that?

      Comment

      • yuri
        Member
        • Mar 2014
        • 9179

        #4
        Unfortunately, it's not possible with bool fields. True and False are considered non-null values.

        You can use the Checklist field instead. With only one option. You can set it required, then the user will have to check that one option to pass the validation. Hope it will work.
        If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

        Comment


        • yuri
          yuri commented
          Editing a comment
          If you still need to store it as a boolean internally, you can set the value with formula script (or a workflow maybe).
      Working...