1-Create Table --->TableA
2-Add Two fields Num and SerialNumberFormat
3-Run following job after inserting data in Num Field
static void OneFieldToAnotherField(Args _args)
{
TableA t1;
;
ttsbegin;
while select forupdate t1 where t1.Num == t1.num
{
t1.SerialNumberFormat = t1.num;
t1.Num = "";
t1.update();
}
ttscommit;
}
==============================================
code for update data for all company in ax:
static void JobTest(Args _args)
{
DataArea DataArea;
TableA t1;
while select DataArea where !DataArea.isVirtual
{
t1.clear();
t1 = null;
changecompany (DataArea.Id)
{
ttsbegin;
while select forupdate t1 where t1.Num == t1.num
&& t1.dataAreaId == t1.dataAreaId
{
t1.SerialNumberFormat = t1.num;
//t1.Num = "";
t1.doUpdate();
}
ttscommit;
t1= null;
}
}
}
2-Add Two fields Num and SerialNumberFormat
3-Run following job after inserting data in Num Field
static void OneFieldToAnotherField(Args _args)
{
TableA t1;
;
ttsbegin;
while select forupdate t1 where t1.Num == t1.num
{
t1.SerialNumberFormat = t1.num;
t1.Num = "";
t1.update();
}
ttscommit;
}
==============================================
code for update data for all company in ax:
static void JobTest(Args _args)
{
DataArea DataArea;
TableA t1;
while select DataArea where !DataArea.isVirtual
{
t1.clear();
t1 = null;
changecompany (DataArea.Id)
{
ttsbegin;
while select forupdate t1 where t1.Num == t1.num
&& t1.dataAreaId == t1.dataAreaId
{
t1.SerialNumberFormat = t1.num;
//t1.Num = "";
t1.doUpdate();
}
ttscommit;
t1= null;
}
}
}
No comments:
Post a Comment