Thursday 27 March 2014

Code for Deleting address information in ax 2012

static void Delete_vendTable(Args _args)
{
DirPartyPostalAddressView DirPartyPostalAddressView;
VendTable vendTable;
CustTable  CustTable;
LogisticsLocation location;
;

ttsBegin;

while select CustTable
{
info(strFmt("Customer %1",CustTable.AccountNum));

while select DirPartyPostalAddressView where DirPartyPostalAddressView.Party == CustTable.Party
                                          && !DirPartyPostalAddressView.IsPrimary
{
location = LogisticsLocation::find(DirPartyPostalAddressView.Location,true);

if(location.validateDelete())
location.delete();
}
}

ttsCommit;
}

1 comment:

  1. You have done a brilliant job making sure that people understand where you are coming from. And let me tell you, I get it. Please post more updates to cure.
    usps change of address

    ReplyDelete