This example updates a table across all companies in Axapta.
static void UpdateProjBudgetTable(Args _args)
{
DataArea dataArea;
DataAreaId dataAreaId;
ProjBudgetTable projBudgetTable;
;
while select dataArea where dataArea.isVirtual == NoYes::No
{
dataAreaId = dataArea.id;
changeCompany(dataAreaId)
{
projBudgetTable = null;
ttsbegin;
while select forupdate projBudgetTable
{
if(projBudgetTable.PrincipalType == "Charterer")
{
projBudgetTable.PrincipalType = "Owner";
}
else if(projBudgetTable.PrincipalType == "Owner")
{
projBudgetTable.PrincipalType = "Charterer";
}
projBudgetTable.doUpdate();
}
ttscommit;
}
}
}
Happy Daxing :)
static void UpdateProjBudgetTable(Args _args)
{
DataArea dataArea;
DataAreaId dataAreaId;
ProjBudgetTable projBudgetTable;
;
while select dataArea where dataArea.isVirtual == NoYes::No
{
dataAreaId = dataArea.id;
changeCompany(dataAreaId)
{
projBudgetTable = null;
ttsbegin;
while select forupdate projBudgetTable
{
if(projBudgetTable.PrincipalType == "Charterer")
{
projBudgetTable.PrincipalType = "Owner";
}
else if(projBudgetTable.PrincipalType == "Owner")
{
projBudgetTable.PrincipalType = "Charterer";
}
projBudgetTable.doUpdate();
}
ttscommit;
}
}
}
Happy Daxing :)
No comments:
Post a Comment