0

I've been working on the filter below but it does not return any result. Can you guys please tell me what's wrong with my code? Thanks!

Goal is to find a record where ClientId_Boxhill = CenterClientID OR ( FirstName=CenterFirstName AND Surname=CenterSurname AND MobilePhone=CenterMobilePhone AND MobilePhone!=null AND MobilePhone !="61400000000" )

Version A

var filterc2 = {
    LeftOperand: {
        Property: "CliendId_Boxhill",
        SimpleOperator: "equals",
        Value: CenterClientId
    },

    LogicalOperator: "OR",

    RightOperand: {
        LeftOperand: {
            Property: "FirstName",
            SimpleOperator: "equals",
            Value: CenterFirstName
        },

        LogicalOperator: "AND",

        RightOperand: {
            LeftOperand: {
            Property: "Surname",
            SimpleOperator: "equals",
            Value: CenterSurname
            },

            LogicalOperator: "AND",

            RightOperand: {
                LeftOperand: {
                    Property: "MobilePhone",
                    SimpleOperator: "isNotNull"
                },

                LogicalOperator: "AND",

                RightOperand: {
                    LeftOperand: {
                        Property: "MobilePhone",
                        SimpleOperator: "notEquals",
                        Value: "61400000000"
                    },

                    LogicalOperator: "AND",

                    RightOperand: {
                        Property:"MobilePhone",
                        SimpleOperator: "equals",
                        Value: CenterMobilePhone
                    }

                }
            }
        }
    }
};

Version B

var filter1 = {
    LeftOperand: {
        Property: "FirstName",
        SimpleOperator: "equals",
        Value: CenterFirstName
    },

    LogicalOperator: "AND",
    RightOperand: {
        LeftOperand: {
        Property: "Surname",
        SimpleOperator: "equals",
        Value: CenterSurname
        },

        LogicalOperator: "AND",

        RightOperand: {
            Property: "MobilePhone",
            SimpleOperator: "equals",
            Value: CenterMobilePhone
        }
    }
};

var filter2 = {
    LeftOperand: {
        Property: "MobilePhone",
        SimpleOperator: "isNotNull"
    },

    LogicalOperator: "AND",
    
    RightOperand: {
        Property: "MobilePhone",
        SimpleOperator: "notEquals",
        Value: "61400000000"
    }
};

var filter3 = {
    LeftOperand: filter1,
    LogicalOperator: "AND",
    RightOperand: filter2
};

var filterc2 = {
    LeftOperand: filter3,
    LogicalOperator: "OR",
    RightOperand: {
        Property: "CliendId_Boxhill",
        SimpleOperator: "equals",
        Value: CenterClientId
    }
};
  • there is a typo in both versions: "CliendId_Boxhill" – Jonas Lamberty Nov 20 at 13:50
  • Ohh. thanks. I didn't even notice that. Will fix it and hopefully it would work – Shiela Faustino Nov 22 at 21:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.