Has anyone ever gotten this error while running a ...
# suitescript
b
Has anyone ever gotten this error while running a saved search? ------- {"reaction":{}} It's very strange. I was trying to do a Formula Text It works in the UI, but throws this strange error in the code
Copy code
CASE WHEN 1=1 THEN '{"priorityPoints":0,"fulfillmentModifier":"","priorityRankText":""}' ELSE '{"priorityPoints":0,"fulfillmentModifier":0}' END
s
Never seen it but that looks like a pretty silly CASE WHEN conditional
b
It is very silly. its a test case to insure a certain result
c
Are you loading an already defined search containing the above, or are you doing all of it via code? Share your code if so
b
We are allowing a user to define some rules, and have validation to insure that it wouldn't fail in a saved search.
Copy code
var searchColumn = search.createColumn({name: "formulatext", formula: formulaString, label: "Formula (text)"});
 var testPriorityRuleSearch = search.create({
                        type: "salesorder",
                        filters:
                        [
                           ["type","anyof","SalesOrd"], 
                           "AND", 
                           ["custrecord_byu_wms_sop_so.custrecord_byu_wms_sop_status","anyof",sopConstants.BYU_SOP_RECORD_STATUSES.ACTIVE], 
                           "AND", 
                           ["datecreated","on","today"]
                        ],
                        columns:[searchColumn]
                     });
When formula string is CASE WHEN {item.name}='1' THEN '{"priorityPoints":0,"fulfillmentModifier":"","priorityRankText":""}' ELSE '{"priorityPoints":0,"fulfillmentModifier":0}' END
It works
Copy code
CASE WHEN 1=1 THEN '{"priorityPoints":0,"fulfillmentModifier":"","priorityRankText":""}' ELSE '{"priorityPoints":0,"fulfillmentModifier":0}' END
Throws the weird error
b
is the string properly escaped?
b
Which string
Copy code
The only difference between the two is ---- 1=1 vs. {item.name}='1'
b
Copy code
CASE WHEN 1=1 THEN '{"priorityPoints":0,"fulfillmentModifier":"","priorityRankText":""}' ELSE '{"priorityPoints":0,"fulfillmentModifier":0}' END
b
My biggest question is that it seems weird a saved search would throw an error that isn't an error -- {"reaction":{}}
b
you only get guesses on that one
i would guess it doesnt like the quotes