I have a saved search for an item fulfillment. I n...
# suitescript
a
I have a saved search for an item fulfillment. I need to join information on the item sublist of the fulfillment from the item sublist of the sales order. Is there a way to get only the sublist line of the sales order that are associated with the sublist lines of the fufillment without getting tons of extra data?
b
depending on which direction you are starting from, use the applied to transaction or applying transaction join
s
@Azi
Copy code
var vendorpaymentSearchObj = search.create({
type: "vendorpayment",
filters: [
[
"type", "anyof", "VendPymt"
],
"AND",
[
"custbody_9997_pfa_record", "anyof", context.newRecord.id
],
"AND",
[
"mainline", "is", "F"
]
],
columns: [
search.createColumn({ name: "currency", summary: "GROUP", join:"appliedtotransaction", label: "Currency" }),
search.createColumn({ name: "creditfxamount", summary: "GROUP",join:"appliedtotransaction",  label: "Amount (Foreign Currency)" }),
search.createColumn({ name: "formulacurrency", summary: "SUM", formula: "{appliedtotransaction.creditfxamount}*{appliedtotransaction.exchangerate}", label: "Amount (Bank Currency)" }),
search.createColumn({ name: "statusref", summary: "GROUP", join:"appliedtotransaction", label: "Status" })
]
})
the general idea is in these searches you can do joins, in this case i'm getting Bill level information on a Bill Payment search The joins work both ways, so I'd create a transaction search with these fields and joins and figure out what you need