mrob
10/18/2023, 11:48 PMmrob
10/18/2023, 11:48 PMvar poSearchResult = search.create({
type: 'purchaseorder',
filters: [['tranid', 'is', poNumber]],
columns: [
search.createColumn({
name: 'entity',
join: 'custbody_rsm_so_reference'
})
]
}).run().getRange(0, 1)[0]
returns
JSON.stringify(poSearchResult.toJSON())
'{"recordType":"purchaseorder","id":"4157617","values":{"custbody_rsm_so_reference.entity":[{"value":"306","text":"Tax Agency DE"}]}}'
mrob
10/18/2023, 11:49 PMmrob
10/18/2023, 11:51 PMec
10/19/2023, 12:28 AM{mainname}
and therefore it is pulling the line name for that particular tax line or whatever it may be.
trick is to run the search in UI and see what the results look like. try to limit also the search to main line is true, perhaps, for the associated sales order. that will eliminate this issue as well.mrob
10/19/2023, 12:33 AMec
10/19/2023, 12:33 AMmrob
10/19/2023, 12:34 AMtranid
field translates to didn't workmrob
10/19/2023, 12:34 AMec
10/19/2023, 12:34 AMmrob
10/19/2023, 12:34 AMmrob
10/19/2023, 12:35 AMDocument Number/ID
finally workedec
10/19/2023, 12:35 AMmrob
10/19/2023, 12:35 AMec
10/19/2023, 12:36 AMec
10/19/2023, 12:36 AMmrob
10/19/2023, 12:36 AMName
is the customer??mrob
10/19/2023, 12:36 AMec
10/19/2023, 12:36 AMmrob
10/19/2023, 12:37 AMmrob
10/19/2023, 12:37 AMec
10/19/2023, 12:38 AMec
10/19/2023, 12:38 AMec
10/19/2023, 12:39 AMec
10/19/2023, 12:40 AMmrob
10/19/2023, 12:41 AMmrob
10/19/2023, 12:41 AMec
10/19/2023, 12:41 AMmrob
10/19/2023, 12:42 AMec
10/19/2023, 12:43 AMDocument Number
= poNumber for the first filter. next, SO Reference fields…
(join, bottom of list) should be filtered as well to Main Line = true.
results: pull in SO Reference fields…
(join, bottom of list) and then the sales order Main Line Name
ec
10/19/2023, 12:44 AMec
10/19/2023, 12:44 AMmrob
10/19/2023, 12:44 AMmrob
10/19/2023, 12:44 AMmrob
10/19/2023, 12:44 AMvar purchaseorderSearchObj = search.create({
type: "purchaseorder",
filters:
[
["type","anyof","PurchOrd"],
"AND",
["numbertext","is","SCI948683"],
"AND",
["mainline","is","T"]
],
columns:
[
search.createColumn({
name: "mainname",
join: "CUSTBODY_RSM_SO_REFERENCE",
label: "Main Line Name"
})
]
});
ec
10/19/2023, 12:44 AMmrob
10/19/2023, 12:45 AMmrob
10/19/2023, 12:45 AMec
10/19/2023, 12:45 AMname: "mainname",
join: "CUSTBODY_RSM_SO_REFERENCE"
})mrob
10/19/2023, 12:45 AMec
10/19/2023, 12:46 AMec
10/19/2023, 12:46 AMmrob
10/19/2023, 12:46 AM