Hi everyone. Does anyone know how to fetch the ref...
# general
u
Hi everyone. Does anyone know how to fetch the reference ID from a sublist in a Purchase Order? For context, the script I'm editing is using Suitescript 1.0, and I'm trying to fetch a field labeled "Packing Size" in a Purchase Order's Item Sublist, but using either record.getLineItemValue or record.getLineItemText doesn't seem to get the value off of it. It's not specifically tied to a field of the item's record, so at the moment I've no clue how to retrieve it. Anyone have any ideas?
b
what did your attempts look like in code?
u
Hi battk, Sorry for the late response, I was still working on the thing and somehow managed to solve my own problem. I solved it by opening the console in the browser, and using Suitescript 1 code to fetch fields from the Purchase Order's record. Specifically I used nlapiLoadRecord, used getAllLineItemFields on the loaded record, then used getLineItemValue and tested every value that seemed feasible via alert. For anyone who chances on this, here's how it played out: var a = nlapiLoadRecord('purchaseorder',381345) a.getAllLineItemFields('item') var b = a.getLineItemValue('item','custcol3',1) alert(b) After finding the correct field, it was just a matter of inserting it alongside the script and its HTML template dependency, figuring out the column spanning manually. Again, sorry I took so long to respond, and thanks for responding regardless!