Trigger MultiCompany Direct with BPM

I am attempting to process multi-company direct on demand in a BPM to ensure a globally linked record is immediately available for further processing. I am getting stuck on TableSets vs DataSets (I think). Take a look at the following:

using(var MultiCompanyDirect = Ice.Assemblies.ServiceRenderer.GetService<Erp.Proxy.Proc.MultiCompanyDirectImpl>(Db))
{

MultiCompanyDirectTableset MDS = MultiCompanyDirect.GetNewParameters();

MultiCompanyDirectParamRow paramRow = MDS.MultiCompanyDirectParam[0];

paramRow.LogFilename="MultiCompanyDirect.log";
paramRow.ProcessingDelay=1;
paramRow.TransferMethod="DIRECT";
paramRow.ProcessingBranch="MT";
paramRow.AgentID="SystemTaskAgent";
paramRow.WorkstationID="BPM";


The error produced is:
Cannot implicitly convert type ‘Erp.Proc.MultiCompanyDirectDataSet’ to ‘Erp.Tablesets.MultiCompanyDirectTableset’

Any ideas?

Brad

Can you do:

MultiCompanyDirectParamRow paramRow = new MultiCompanyDirectParamRow();
BufferCopy.Copy(MDS.MultiCompanyDirectParam[0],paramRow);

The problem is the establishment of the MDS tableset (dataset?). In my code, the error seems to be on the line:
MultiCompanyDirectTableset MDS = MultiCompanyDirect.GetNewParameters();

Try just using “var”:

var MDS = MultiCompanyDirect.GetNewParameters();

var paramRow = MDS.MultiCompanyDirectParam[0];

That got it to compile! However it then had an error on execution which led me to the core problem: I had used Erp.Proxy.Proc.MultiCompanyDirectImpl and should have been using Erp.Contracts.MultiCompanyDirectSvcContract. Once changed, it compiled with the original variable declarations and ran flawlessly. Thanks for the help!

Brad