CrossCompany insert Code
The following code are my Test.i cant assure that this code will work as you expect.
static void crosscompantinsert(Args _args)
{
TMSSalesTable tableFrom,tableTo;
str destinationCompany="USRT";
str curCompany;
#avifiles
SysOperationProgress oProgress;
int nTotal;
#define.TITLE("Copying data...");
curCompany=curext();
if(curCompany=="USMF")
{
select count(RecId) from tableFrom;
// nTotal=tableFrom.RecId;
oProgress=SysOperationProgress::newGeneral(#aviUpdate,#TITLE,nTotal);
tableFrom.clear();
while select tableFrom
{
changeCompany(destinationCompany)
{
tableTo=null;
ttsBegin;
buf2Buf(tableFrom,tableTo);
tableTo.insert();
ttsCommit;
}
oProgress.incCount();
}
oProgress.hide();
}
else
{
info("Cannot be processed");
}
}
The following code are my Test.i cant assure that this code will work as you expect.
static void crosscompantinsert(Args _args)
{
TMSSalesTable tableFrom,tableTo;
str destinationCompany="USRT";
str curCompany;
#avifiles
SysOperationProgress oProgress;
int nTotal;
#define.TITLE("Copying data...");
curCompany=curext();
if(curCompany=="USMF")
{
select count(RecId) from tableFrom;
// nTotal=tableFrom.RecId;
oProgress=SysOperationProgress::newGeneral(#aviUpdate,#TITLE,nTotal);
tableFrom.clear();
while select tableFrom
{
changeCompany(destinationCompany)
{
tableTo=null;
ttsBegin;
buf2Buf(tableFrom,tableTo);
tableTo.insert();
ttsCommit;
}
oProgress.incCount();
}
oProgress.hide();
}
else
{
info("Cannot be processed");
}
}
No comments:
Post a Comment