I am struggling with creating a BPM to set territory source on all new ship to’s to be synchronized to customer.
I also need to bring in current data through DMT and need to allow this BPM or have the ability to set it to synchronize to customer.
Did you ever get an answer to this or figure it out? I was just trying to do the same in our system. I thought I could set the initial value of the field in app studio, but that didn’t work out.
We solved this in an In-Transaction Data Directive in the ShipTo table. Created a CustomerTableset variable in the BPM to capture ShipTo’s Parrent Company data then used that data to override select ttShipTo fields.
@jlubow, thank you! I’m going to try this in our Pilot environment. Can you share the condition you have on Added Row? Is it, “There is at least one added row in the ttShipTo table”?
@jlubow I’m close, but I can’t seem to get the Set Territory Select to work correctly. Would you mind sharing a screenshot of your Fill Table Configured mapping and your Set Territory Select setups?
@jacobm Here are some additional details:
Initializing Variable myCustNum Type = Integer
Initializing Variable myCustTables Type = Customer Tableset
- Set myCustNum = ttShipToRow.CustNum
- Fill Table by Query; Query is returning all columns from the ERP.Customer table with Criteria Company = BAQ CurrentCompany constant AND CustNum = @myCustNum argument/variable. Filles myCustTables.Customer with mapping set using the “Bind Automatically” button (note I have way more data brought in than required for this but I like to have all colums filled out when possible.)
- Set the ttShipTo.TerritorySelect = “SYNC”, ttShipTo.TerrirtoryID = myCustTablesCustomerRow.TerritoryID, and ttShipTo.SalesRepCode = myCustTablesCustomerRow.SalesRepCode
@jlubow interesting, that’s what I had except I didn’t show/map all of the fields, I just did the two I needed. When I click + to create a new ship to the Territory Source still defaults to System Select. If I try saving I get the “A valid Territory ID is required”. If I then click get territory and save it does override the system selected territory and salesperson to the right values, but Territory Source still shows System Select. After some additional research I found setting the TerritorySelectFlag field seems to work, but that field isn’t available in the temporary table.
95% of of the time our team is pushing OTS from the sales orders as a ShipTo record and is not going into the customer record to do that which is why this automation works well for us. This prevented the need of going into the ShipTo record to update it after creation. I suppose if working in the ship to record to start, a standard directive could be looked at to preset the TerritorySelect flag to be “SYNC” though wouldn’t be required as the in-transaction method as shown here overwrites it at the time of update.
Ahh, I just created a ship-to from an OTS on a sales order and it updated the territory source to synchronize to customer. That’s how I’ll train it out after importing into our live environment. Thanks again for your help!