Corey Schwoebel
06/26/2023, 1:56 PMvar shipDate = context.newRecord.getValue({ fieldId: 'shipdate' })
var shipAddress = context.newRecord.getText({ fieldId: 'shipaddress' })
search.create({
type: "invoice",
filters:
[
["type", "anyof", "CustInvc"],
"AND",
["mainline", "is", "T"],
"AND",
["shipdate", "on", shipDate],
"AND",
["shipmethod", "anyof", "69"],
"AND",
["shipaddress","is", shipAddress],
"AND",
["anylineitem", "anyof", "15942"]
],
columns:
[
search.createColumn({ name: "entity", label: "Name" }),
search.createColumn({ name: "shipaddress", label: "Shipping Address" })
]
}).run()
I'm sure this is a data type or formatting issue. Anyone have any advice on how to format the address either in the script or in the search to get them to match?Corey Schwoebel
06/26/2023, 2:40 PMCorey Schwoebel
06/26/2023, 2:41 PMCorey Schwoebel
06/26/2023, 3:30 PMvar shipAddr1 = context.newRecord.getText({fieldId: 'shipaddr1'})
var shipAddr2 = context.newRecord.getText({fieldId: 'shipaddr2'})
var shipAddr3 = context.newRecord.getText({fieldId: 'shipaddr3'})
var shipCity = context.newRecord.getText({fieldId: 'shipcity'})
var shipState = context.newRecord.getText({fieldId: 'shipstate'})
var shipZip = context.newRecord.getText({fieldId: 'shipzip'})
search.create({
type: "invoice",
filters:
[
["type","anyof","CustInvc"],
"AND",
["mainline","is","T"],
"AND",
["shipdate","on",shipdate],
"AND",
["shipmethod","anyof","69"],
"AND",
["anylineitem","anyof","15942"],
"AND",
["shippingaddress.address1","is",shipAddr1],
"AND",
["shippingaddress.address2","is",shipAddr2],
"AND",
["shippingaddress.address3","is",shipAddr3],
"AND",
["shipcity","is",shipCity],
"AND",
["shipstate","anyof",shipState],
"AND",
["shipzip","is",shipZip]
],
columns:
[
search.createColumn({name: "entity", label: "Name"}),
search.createColumn({name: "shipaddress", label: "Shipping Address"})
]
}).run()
Anthony OConnor
06/26/2023, 4:10 PMAnthony OConnor
06/26/2023, 4:10 PMCorey Schwoebel
06/26/2023, 4:10 PMAnthony OConnor
06/26/2023, 4:11 PMAnthony OConnor
06/26/2023, 4:11 PMCorey Schwoebel
06/26/2023, 4:13 PMAnthony OConnor
06/26/2023, 4:15 PMCorey Schwoebel
06/26/2023, 4:18 PM