Skip to Content
avatar image
Former Member

Set item.ShipFromItemLocation on Sales order when Auto-determination is not used

It appears that I can not set the item.ShipFromItemLocation on a Sales order if Auto-determination is not used.

My Goal is to use a Custom set of rules to determine the Source of Supply. However there does not seem to be a way to set the item.ShipFromItemLocation See Code Below

///root= Sales order
foreach(var item in root.Item) {
 if (!item.ShipFromItemLocation.IsSet()) { // DOES NOT EXIST	
  item.FulfilmentPartyCategoryCode.content = "1"; // Internal
  var IL = item.ShipFromItemLocation.Create(); //CREATE NODE  ALWAYS RETURNS NULL
  if (IL.IsSet()) { // ALWAYS NOT SET
   IL.LocationID = "3"; //WILL NEVER GET HERE
  }
 } else {
  item.ShipFromItemLocation.LocationID = "3"; //CAN SET IT HERE IF ALREADY DEFAULTED
 }
}
<br>
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

0 Answers