Has anyone been able to get the preferred vendor o...
# suitescript
s
Has anyone been able to get the preferred vendor on the item record when the Multiple Vendor feature is enabled?
s
Yeah its pretty straightforward, preferredvendor is available in the search module, also you can loop the vendor sublist with record module and get that way, depends your context.
s
so there's a column name that is preferredvendor? isn't this preferred vendor field id vendor? I am doing a search on an ss service and tried the lookupField functionality with the "vendor" field id and came back blank. Going through the docs it said if the Multiple Vendor feature was enabled the preferred vendor field set would not work, and it's true cause is coming back null to the frontend.
@Sandii even if I create a Column using a JOIN with the preferredvendor I get as a return an empty array as a value for that field
s
You cant use search.lookupFields to get sublist values. Preferred vendor is a column if you create a regular search
s
I did create a regular seach but when I try and access through script the values aren't there, the come back blank
s
The column
vendor
is the preferred vendor when doing an item search.
Copy code
var itemVendorArr= search.create({
   type: "item",
   filters: [],
   columns: ["itemid", "vendor"]
}).run().getRange(0,1000).map(res => res.toJSON());
s
Yes but the multiple vendor feature is enabled so this search will bring me back the column vendor with an empty array, and I know for a fact that the item has values
s
No it wont, I just did it
message has been deleted
s
I AM TALKING IN SCRIPT NOT IN UI!!!
s
The script I provided is the exact same search as the UI
message has been deleted
GOOD LUCK THOUGH SINCE YOU WANT TO YELL AT SOMEONE SPOONFEEDING YOU WHAT TO DO
s
I'm sorry about yelling but this makes no sense I'm doing the same thing and I get balnk values in the vendor column as a result are you positive that the Multiple Vendor is enabled and you have more than 1 vendor in the item
s
I showed you the screen shot, just paste your code here, probably missing something small