Entity Manager - Visible Fields

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bradaks
    Active Community Member
    • Aug 2017
    • 251

    Entity Manager - Visible Fields

    Hello,

    I am attempting a visibility filter for an entity. I have the filter set up like this:


    Once applied it save the filter like this:

    (
    Assignment Type = Event
    AND
    (
    Account = XXXXXX
    )
    )

    The field will only show if the type is event and the account is equal to XXXXX. I want it to show if the assignment is an event OR the account is XXXXXX.
  • yuri
    Member
    • Mar 2014
    • 8440

    #2
    Hi,

    It corresponds to (statement_1 AND (statement_2)).

    You need (statement_1 OR statement_2).
    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

    • bradaks
      Active Community Member
      • Aug 2017
      • 251

      #3
      Hello,

      In the conditional manager, I put the OR statement in but it defaults to AND after applying the change.

      Comment

      • bradaks
        Active Community Member
        • Aug 2017
        • 251

        #4
        Here is the JSON output:

        Code:
                    "participants": {
                        "visible": {
                            "conditionGroup": [
                                {
                                    "type": "or",
                                    "value": [
                                        {
                                            "type": "equals",
                                            "attribute": "accountId",
                                            "data": {
                                                "field": "account",
                                                "values": {
                                                    "accountName": "XXXXXX"
                                                }
                                            },
                                            "value": "5a7381eeb02b30917"
                                        }
                                    ]
                                },
                                {
                                    "type": "or",
                                    "value": [
                                        {
                                            "type": "equals",
                                            "attribute": "assignmentType",
                                            "value": "Event"
                                        }
                                    ]
                                }
                            ]
                        }
                    },

        Comment

        • tanya
          Senior Member
          • Jun 2014
          • 4308

          #5
          You have to do it in the same OR section, don't create another one


          Code:
            
              "participants": {
                  "visible": {
                      "conditionGroup": [{
                          "type": "or",
                          "value": [{
                                  "type": "equals",
                                  "attribute": "accountId",
                                  "data": {
                                      "field": "account",
                                      "values": {
                                          "accountName": "XXXXXX"
                                      }
                                  },
                                  "value": "5a7381eeb02b30917"
                              },
                              {
                                  "type": "equals",
                                  "attribute": "assignmentType",
                                  "value": "Event"
                              }
                          ]
                      }]
                  }
              }
          Last edited by tanya; 05-16-2018, 02:58 PM.

          Comment

          • bradaks
            Active Community Member
            • Aug 2017
            • 251

            #6
            Thanks for the clarification,

            Do you know why I cannot make this happen without editing the JSON directly? Should be able to make this happen in the entity manager?

            Comment

            • yuri
              Member
              • Mar 2014
              • 8440

              #7
              You need to add OR group first. Then add fields inside.
              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

              • bradaks
                Active Community Member
                • Aug 2017
                • 251

                #8
                Oh wow! Why was that so hard for me to understand. THanks so much for the clarification.

                Comment

                Working...