Hi all, having some issue calling a restlet from ...
# suitescript
k
Hi all, having some issue calling a restlet from postman
Copy code
if (datareceived.externalid != null) {
    const extId = datareceived.externalid.toString();
    if (extId.indexOf(",") > 0){
        log.debug("externalid has comma");                      
        formattedExtId = "\"" + extId.replace(",", "\",\"")+ "\"";
    } else {
        formattedExtId = extId;
    }
    log.debug("formattedExtId: " + formattedExtId);
    filterArray.push("AND");
    filterArray.push(["externalid", "anyof", formattedExtId]);
    log.debug("externalid is provided: " + datareceived.externalid);
}
we need to know how to pass a list of values in an anyof filter
c
In your approach, you're sending a string value as the third element in your filter expression array, which means it's attempting to evaluate the external ID as equivalent to the full string. You should use an array instead.
m
Copy code
const exIds = [1123,123,123,123]

filterArray.push(["externalid", "anyof", exIds]);