Using IN operator along with formula text in search filter

When “anyof” operator is not available in search criteria then IN operator can be used as following:

    
    let lineUniqKey = ["48662","48663","48664","48665"];
    let uniqKeyIfMapping = {}; // Object to store the mapping of lineUniqKey to IF number
    let inClauseValues = lineUniqKey.map(value => `'${value}'`).join(","); // Convert array to IN clause string
    let filters = [
        [
            ["type", "anyof", "ItemShip"],
            "AND",
            ["formulatext: CASE WHEN {custcol_mhi_ibs_request_key} IN (" + inClauseValues + ") THEN 1 ELSE 0 END", "is", "1"]
        ]
    ];

Leave a comment

Your email address will not be published. Required fields are marked *