I am looking to copy Sales Order from one company to an other (both companies are in different continents and use different currencies, and different tax setup).
I am looking to copy Orders across as is (within BPM), then alter DataSet to reflect the properties of the destination company (within the BPM).
All I have tried using the SalesOrderAdapter (within BPM) can only give me the OrderHed in the destination company or give me a new copy of the Order within the source company (that could already be achieved using “copy order” option in the “Order Entry” menus).
The closest options I have seen are those found search for SalesOrderAdapter, but they do not totally address my issue, though I have used fill table by query and mapped required fields to query and used set variables to alter vales I needed changed in the destination company.
I am looking to populate all 16 ttTable in the destination company.
Using two instances of BoAdapter, one to create OrderHed and the 2nd to create everything else (getting OrderNum from the 1st) completes with no errors (no errors in the BO error dataset) but no records with the new order number are created.
Am not using multi-company because the current setup, parts, warehouse and accounting arrangements are not geared towards multi-company and implementing multi-company for the sake of duplicating orders outweighs the benefits (at the moment).
I will look into EDI and see how that goes.
Both companies are in same DB and on same license.
Hmm
In that case… You can’t change companies on a BPM. But on a customization you could switch companies and then switch back .
So get data switch companies in the session create order and switch back. Using the BOs
My apologies in the first place. It has taken 2 days for me to get back to my computer, given the holidays.
Thanks for the information, I tried changing the company in the context fields in a SalesOrder.Update process, so I could do a “Copy Sales Order” operation, but I got the error that the Company field of the user context is read only; I have not been able to find any way of switch companies on the fly within BPMs in the Epicor Guides and Manuals.
If you have any form of spinets or functions to call within certain objects, that will be appreciated.
If the above idea is completely off the table, I am wondering how I can achieve creating the order in one company and have a duplicate in the 2nd company with their respective order numbers relative to each company.
My apologies in the first place. It has taken 2 days for me to get back to my computer, given the holidays.
I looked into creating a work flow in Service Connect but, probably my limited understanding of the complete workings of Service Connect gave me the scare.
Given that the order is going to be copied between two companies with order numbers in different ranges, I was going to map (in Transformation) all fields except system generated and OrderNum, but with 16 tables, most with hundreds of columns as well as hundreds of user defined columns, its going to take countless hours to map all columns and debug any resulting errors.
I will be glad to be pointed in the right direction if any way of mapping just the response rowset and manage to switch the companies somehow with the relevant new Order Number being assigned in the new company across all 16 SalesOrderAdapter tables.
I am also happy to hear if this can be done differently.
Thank you all for you help, I guess its time to put all your suggestions into action where possible, so I am revisiting the drawing board; I will hopefully let you all know of my success in implementing the ideas gathered by next year (2018).
Where for any reason I encounter insurmountable issues, I shall let the group know.
Copy via BPM or SC is proving very deficault with various aspects failing.
I was going to use the GetNewOrderHed, then GetNewOrderDtl, etc
But from BPM, I can not do SalesOrder.GetByID({orderNum}) from another company (this is possible in SC).
While I can do GetNewOrderHed from BPM, no OrderHed is created when done in SC, I am now looking to create individual table records from Data or Method directives and referring to each individual column (from the hundreds) to transfer what I want, but that is a last resort; hence putting the task on hold for a couple of Days.
Hi Justice,
Creating records directly in the Order tables is absolutely a terrible idea… this is not only not supported by Epicor but it can and will lead to corrupted data and orphan records.
Your best bet is to write a simple process using the WCF / REST or SC (externally) not within a BPM… or do it in a Customization where you can easily switch Companies back and fourth.
I’ve done this successfully before in a Customization, all you do is instantiate the BO changing the session.CompanyID to the one you want the record created in.
Creating the records directly in the tables via a DD or BPM without using the BO
s would bypass the Epicor logic and there are a lot of other child / related records that will be missed.