Hello everyone, I am trying create a dropship PO u...
# suitescript
u
Hello everyone, I am trying create a dropship PO using suitescript code
_var_ dropshipPO = _record_.create({
                    
type: _record_.Type.PURCHASE_ORDER,
                    
isDynamic: false,
                    
defaultValues: {
                        
shipgroup: 1,
                        
soid: _soId_,
                        
dropship: true,
                        
custid: _customerId_,
                        
entity: vendorId,
                        
poentity: vendorId
                    
}
                
});
However, this code is not working for some items even though there is a preferred vendor defined on the item record. Any help would be greatly appreciated.
b
what would the url for creating the drop ship po from the ui look like
what are the differences between your code's values
u
This is the URL for which this code is working. However for the items for which the code is not working has different Dropship URL. e.g missing PO entity and entity.
Preferred vendor is set on item record.
b
remove the missing parameters
u
But how do we decide this in code that for this item we need to remove these parameters? I mean this code works for a lot of items.
What I want to know is, On which basis, netsuite is picking the dropship parameters.
I mean if preferred vendor is set on item A and item B, then what my point is why the Dropship URL is different for both Items?
b
dont know, you can try experimenting
and seeing what the diferences are betwen the items and sales orders
id imagine that no poentity means that the item is invalid
though you probably would have been able to tell that when you couldn't save the purchase order for the item even by removing the missing parameters