How to update vendor addresses in Dynamics AX 2009

One of the blog contact ask a question, how we can update the address for a vendor in Dynamics ax 2009,  below job is the possible answer and may helps.
static void J1A_UpdateVendAddressType(Args _args)
{
VendTable vendTab; //
Replace VendTable with CustTable when run this for
customers.
DirPartyTable dirPartyTab;
Address addTab;
;
ttsbegin;
while select vendTab join dirPartyTab
join forupdate addTab
where vendTab.PartyId == dirPartyTab.PartyId
&& addTab.AddrTableId == dirPartyTab.TableId
&& addTab.AddrRecId == dirPartyTab.RecId
{
      if(addTab.Name == ‘Birincil Adres’)
     {
        addTab.type = AddressType::Payment;
addTab.update();
     }
}
ttscommit;
}
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: