Anyone ever script inventory transfers? Why wouldn...
# suitescript
z
Anyone ever script inventory transfers? Why wouldn’t something like
Copy code
var transferLoc = search.lookupFields({
      type: 'inventorytransfer',
      id: recId,
      columns: ['transferlocation']
    });
not work?
r
@zach_calh You type doesn’t look right
it should be something like
type : search.Type.INVENTORY_TRANSFER,
b
Yeah, check your formatting. I believe 'transferlocation' should be "transferlocation" as well.
r
No, transferlocation is fine. Just not the type.
@zach_calh Can you confirm that there is a transferlocation on the record you specifying?
z
The type shouln’t be wrong
search.Type.INVENTORY_TRANSFER is just an enum for ‘inventorytransfer’
r
ok well, if you view that recId does it have a transferlocation?
z
Of course 😛
The record has a transfer location - just can’t figure out why it doesn’t appear in searches
I think it has something to do with how the lines are used on the record…just can’t figure out how they are used.
b
Are you able to return other information from the record? If you change your column to date or tranid do you get results?
z
Yes - it looks like something is specifically wrong with the
inventorylocation
field
Thanks for helping guys! I figured it out. On line items, the negative quantity is the “from” location and the positive is the “to” location for inventory transfers