I had to write a BPM to pull the data from the CustMFBill and ShipToMFBill. We have a certain logic we use depending on the Customer/ShipTo/3PShipTo, but all of our records only have 1 MFBill method defined, so it’s pretty straight forward.
We basically use 3 BO Post-Processing methods in the Erp.BO.SalesOrder:
I have created a BPM as well for the ShipToMFBill as this is what Sales said they would only use. We use Quick Ship for UPS, FedEx, and DHL. I have logic in there to determine which Ship Via is selected then go and look for the corresponding entry associated with the selected Ship To. In order to ship against the customer account in Quick Ship, the bill type for FedEx needs to be FedEx Recipient and UPS or DHL needs to be UPS Freight Collect. There is logic to verify if the account number for those have the correct number of digits as well. I have done this in the SalesOrder.Update in the Pre-Processing method and check for added row or changes to Ship Via, Bill Type, Pay Account, Ship To, Customer ID, or Ship To Customer ID then run the code.
I have also created a BPM on the Customer Shipment determining if the Ship To is different on the Sales Order Release from the Sales Order Header and if it is run similar logic to retrieve the ShipToMFBill from the Ship To associated to the Sales Order Release and if that does not exist then keep how the Sales Order Header is setup. This is only done for the first Pack Line.
Thanks for the Info. Thats about where I was at. well at least to the Change Customer portion of it. when ever I try to construct my BPM which I’m sure I’m doing wrong I get a “Key already exists, key: 00000000-0000-0000-0000-000000000000::OrderHed.OrderNum=0” error. I was using a Fill Table by Query object in my BPM does that sound on track or should I re think that approach?
Doug,
I know this was an old post, but I am trying to do the same thing that you have already accomplished. In my testing I found my method directives were not behaving as expecting.
For my test I entered a ShipTo-ShipTo account, saved the record, then I deleted the ShipTo-ShipTo account, to see if the Manifest Billing Info would revert back to the ShipToCust account (Like I had expected), but it did not. When I looked at the value for the ShipToCustNum it shows up as ZERO from the ds.OrderHed.ShipToCustNum and also from the formula: (from x in Db.OrderHed where x.Company == dsOrderHedRow.Company && x.OrderNum == dsOrderHedRow.OrderNum select x.ShipToCustNum).FirstOrDefault()
But on the sales order I am testing with, there is a value for the ShipToCustNum:
I am trying to work out all the changes a CSR might make when entering an order (and updating the Manifest Billing Info accordingly). When you open a new order, Epicor may default the ShipToCustNum to 0 (and then pull over the Sold to number to the ShipToCustNum). But for this case I am using a different SoldToNum than the ShipToCustNum. My testing was to enter a ShipToShipTo record, save it, then delete the ShipToShipTo record. My method on the ChangeShipToID, evaluates if the ShipToID is “” and if so then pull the Manifest Billing Info from the ShipToCustID, but I cannot seem to correct get that number (as it is showing up as ZERO for both ways I have tried to find it).
So I created the order with SoldTo 200669 and Epicor automatically puts that value in as the ShipToCustNum. Then I changed the ShipToCustNum to 200011, then I changed the ShipToShipTo to one of the locations, saved the record, then blanked out the ShipToShipTo field, the ShipToCustNum still remains 200011, but the variable I set comes up showing a value of 0 for some reason.
I think the issue was declaring my variables after some condition statements (and some declared in branches not taken). I think I have it figured out now.