static void updateCustomerStd(Args _args)
{
CustTable custTable,getcustTable;
//Function to set customer record
CustTable createCustTable(CustTable _custTable)
{
AxCustTable axCustTable;
SysDictTable sysDictTable = new SysDictTable(tableNum(CustTable));
int i;
int fieldCnt;
FieldId fieldId;
;
ttsbegin;
axCustTable = AxCustTable::constructValidateInput(_custTable);
fieldCnt = sysDictTable.fieldCntWithoutSys();
for (i=1;i <= fieldCnt;i++)
{
fieldId = sysDictTable.fieldCnt2Id(i);
if (fieldNum(CustTable, AccountNum) != fieldId)
axCustTable.setFieldAsTouched(fieldId);
}
axCustTable.save();
ttscommit;
return axCustTable.custTable();
}
;
ttsBegin;
select forupdate custTable;
info(custTable.AccountNum + " " + custTable.CustGroup + " " + custTable.InvoiceAccount);
custTable.CustGroup = "Corporate";
custTable.InvoiceAccount = "CH0000239";
getcustTable = createCustTable(custTable);
info(getcustTable.AccountNum + " " + getcustTable.CustGroup + " " + getcustTable.InvoiceAccount);
ttsCommit;
}
{
CustTable custTable,getcustTable;
//Function to set customer record
CustTable createCustTable(CustTable _custTable)
{
AxCustTable axCustTable;
SysDictTable sysDictTable = new SysDictTable(tableNum(CustTable));
int i;
int fieldCnt;
FieldId fieldId;
;
ttsbegin;
axCustTable = AxCustTable::constructValidateInput(_custTable);
fieldCnt = sysDictTable.fieldCntWithoutSys();
for (i=1;i <= fieldCnt;i++)
{
fieldId = sysDictTable.fieldCnt2Id(i);
if (fieldNum(CustTable, AccountNum) != fieldId)
axCustTable.setFieldAsTouched(fieldId);
}
axCustTable.save();
ttscommit;
return axCustTable.custTable();
}
;
ttsBegin;
select forupdate custTable;
info(custTable.AccountNum + " " + custTable.CustGroup + " " + custTable.InvoiceAccount);
custTable.CustGroup = "Corporate";
custTable.InvoiceAccount = "CH0000239";
getcustTable = createCustTable(custTable);
info(getcustTable.AccountNum + " " + getcustTable.CustGroup + " " + getcustTable.InvoiceAccount);
ttsCommit;
}
No comments:
Post a Comment