static void updatecustomeraddress(Args _args)
{
CustTable custTable;
DirPartyTable dirPartyTable;
DirPartyLocation dirPartyLocation;
DirPartyLocationRole dirPartyLocationRole;
LogisticsLocation logisticsLocation;
LogisticsLocationRole logisticsLocationRole;
LogisticsPostalAddress logisticsPostalAddress;
while select * from custTable where custTable.AccountNum == "BRIG" // if you want vendor change here
join dirPartyTable
where dirPartyTable.RecId == custTable.Party
join dirPartyLocation
where dirPartyLocation.Party == custTable.Party
// if you want role specific un-commented below code
/*join dirPartyLocationRole
//where dirPartyLocationRole.PartyLocation == dirPartyLocation.RecId
//join logisticsLocationRole
//where logisticsLocationRole.RecId == dirPartyLocationRole.LocationRole
// && logisticsLocationRole.Type == LogisticsLocationRoleType::Delivery*/
join logisticsLocation
where logisticsLocation.RecId == dirPartyLocation.Location
join logisticsPostalAddress
where logisticsPostalAddress.Location == logisticsLocation.RecId
{
ttsbegin;
logisticsPostalAddress.selectForUpdate(true);
logisticsPostalAddress.ValidTimeStateUpdateMode (ValidTimeStateUpdate::Correction);
logisticsPostalAddress.Address = "Test address";
logisticsPostalAddress.update();
ttsCommit;
}
}
No comments:
Post a Comment