adsenseheader

Tuesday, December 21, 2021

Delete or remove customer delivery address in D365 FO

while select custTable
               where   !custTable.Blocked
                    join RecId from dirPartyTable
               where   dirPartyTable.RecId == custTable.Party
                    join RecId from dirPartyLocation
               where   dirPartyLocation.Party == custTable.Party
                    join RecId from dirPartyLocationRole
               where   dirPartyLocationRole.PartyLocation == dirPartyLocation.RecId
                   join RecId from logisticsLocationRole
               where   logisticsLocationRole.RecId == dirPartyLocationRole.LocationRole
                          && logisticsLocationRole.Type == LogisticsLocationRoleType::Delivery
                    join RecId from logisticsLocation
                where   logisticsLocation.RecId == dirPartyLocation.Location
                    join forupdate logisticsPostalAddress
                where   logisticsPostalAddress.Location == logisticsLocation.RecId 
            {
                ttsbegin;
                logisticsPostalAddress.deactivate(custTable);
                ttscommit;
            }

No comments:

Post a Comment