I'm trying to access quantityuom and quantityshipr...
# suitescript
y
I'm trying to access quantityuom and quantityshiprecv for items in an item fulfilment record (via a user event script, on create). I noticed that they both exist at the transaction level, so I suspect they would be inherited? (It used to sit on the IF level at least in "Browser2016_1"): https://www.netsuite.com/help/helpcenter/en_US/srbrowser/Browser2024_1/script/record/transaction.html How can I access these fields? I'm trying to recreate this formula, that was used in a saved search on the IF record (it is a per line item saved search): > NVL({quantityuom},0)-NVL({quantityshiprecv},0) Methods I have tried: 1.
Copy code
if (isKit) {
        //load the item using the internal id
        itemObj = record.load({
          type: record.Type.KIT_ITEM,
          id: itemInternalID,
        });
      } else if (isInventory) {
        //load the item using the internal id
        itemObj = record.load({
          type: record.Type.INVENTORY_ITEM,
          id: itemInternalID,
        });
      }

var quantityuom = itemObj.getValue({
          fieldId: 'quantityuom', 
        });
2.
Copy code
var quantityuom = loadedIF.getSublistValue({
          sublistId: 'item',
          fieldId: 'quantityuom',
          line: i,
        });
3.
Copy code
quantityuom = loadedIF.getValue({
          fieldId: 'quantityuom',
        });
All 3 methods return the result (for both fields): undefined Also, I tried searching here and could not find the field, so I don't know which subrecords to try joining to to load the data out either: https://system.netsuite.com/help/helpcenter/en_US/APIs/REST_API_Browser/record/v1/2024.1/index.html#/definitions/itemFulfillment
1
m
quantityuom in search context outputs quantity in transaction units
when loading & working with a record directly via suitescript the equivalent is "quantity"
contrast: {quantity} in a saved search yields quantity in base units
y
@mbrewer amazing thank you!! That is really helpful to know actually. Is there anywhere where this might be documented, as the other field that I'm also looking for is quantityshiprecv, as in for it's direct suitescript equivalent field? 🙂
m
not that i know of, at this point it's just committed to memory from so many different unit of measure discussions with clients
the suitescript equivalent to the search
quantityshiprecv
is
quantitypickpackship
i don't know if that's documented anywhere, but you should be able to see that value in the line rep when viewing the sales order in XML page view (add
&xml=T
to the page URL)
🙌 1
you can't always access all fields shown in XML page view on a record via suitescript, but you can access most
y
Okay great thank you!