web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Inserting Bank Addresses Question

(0) ShareShare
ReportReport
Posted on by 2,147

I am able to use a class to insert/upload bank information for each vendor.  I need to insert bank addresses (specifically the country code) for each bank.  I know that LogisticsLocation and LogisticsPostalAddress need to be populated.  Has anyone ever done this?  My concern is kwith the recids used to create the relationships between the tables that mentioned to the VendBankAccount table.  It seems that it needs to be generated by the system.  Any help would be appreciated.

Thanks,

Tremor

*This post is locked for comments

I have the same question (0)
  • Community Member Profile Picture
    on at

    Use the framework: LogisticsPostalAddressFormHandler if you are using a form to update the address. Let me see if I understand the requirement, you want to add a space to edit, create, etc the Bank address? Or you only want to display it in some where?

    Thanks!

  • Tremor Olaes Profile Picture
    2,147 on at

    I am importing new vendors using SCI (Armanino's import tool).  I am using class to import the bank information.  I would like to import the bank addresses using a class but not sure how to approach it when recids are involved.  

  • Community Member Profile Picture
    on at

    Well the same way that you are importing the bank information, use the correct relation, or some tables already has the method to return the bank address, the bankAccountTable has the field Location, that is the recId from LogisticsLocation table.

    Use the LogisticsLocation.PostalAddress(); method to return the address, use the relation between the bank table and the logisticsLocation table and use that method.

    I hope this works.

  • Tremor Olaes Profile Picture
    2,147 on at

    Hi Tatiana,  Thanks again for responding.  Maybe I am not understanding your last email, but I am not trying to pull the address, rather trying to import new addresses for the banks. Since the recid appears to be a system generated number, I want to make sure I insert address correctly in the LogisticsLocation and LogisticsPostalAddress tables for the banks that I am also importing.

  • Verified answer
    Community Member Profile Picture
    on at

    you can do It like this:

       BankAccountTable            bankTable;

       LogisticsPostalAddress      postalAddress;

       ttsBegin;

       postalAddress.clear();

       postalAddress.Address = "Example 123123123";

       postalAddress.CountryRegionId = "USA";

       postalAddress.ZipCode = "00210";

       postalAddress.Location = LogisticsLocation::create("NEW ADDRESS").RecId;

       if(postalAddress.validateWrite())

       {

           postalAddress.insert();

       }

       select forUpdate  bankTable where bankTable.AccountNum == "3359006932";

       bankTable.Location = postalAddress.Location;

       bankTable.update();

       ttsCommit;

    Let me know if this is what you are looking for.

  • Tremor Olaes Profile Picture
    2,147 on at

    Hi Tatiana,

    Let me try this and let you know if it works.  Thanks again for the guidance!

    Thanks,

    Tremor

  • Tremor Olaes Profile Picture
    2,147 on at

    I get the following error and location is not updated: " Cannot edit a record in Vendor bank accounts (VendBankAccount). The record has never been selected.

                 postalAddress.clear();

                //postalAddress.Address = "Example 123123123";

                postalAddress.CountryRegionId = _country;

                //postalAddress.ZipCode = "00210";

                postalAddress.Location = LogisticsLocation::create("NEW ADDRESS").RecId;

                   if(postalAddress.validateWrite())

                      {

                          postalAddress.insert();

                      }

               select forUpdate  vendBankAccount where vendBankAccount.AccountNum == _vendAccount;

               {

               vendBankAccount.Location = postalAddress.Location;

               vendBankAccount.update();

               }

  • Verified answer
    Community Member Profile Picture
    on at

    oh well you need to use that variable _VendAccount to select the account that you need to change, in this case you create first the bank account and after you need to create the address related to that account, there is where you use the Update process.

    like this:

       BankAccountTable            bankTable;

       LogisticsPostalAddress      postalAddress;

       ttsBegin;

       postalAddress.clear();

       postalAddress.Address = "Example 123123123";

       postalAddress.CountryRegionId = "USA";

       postalAddress.ZipCode = "00210";

       postalAddress.Location = LogisticsLocation::create("NEW ADDRESS").RecId;

       if(postalAddress.validateWrite())

       {

           postalAddress.insert();

       }

       select forUpdate  bankTable where bankTable.AccountNum == "3359006932";

       bankTable.Location = postalAddress.Location;

       bankTable.update();

       ttsCommit;

    this is the example that I used.

    please try it.

  • Tremor Olaes Profile Picture
    2,147 on at

    Thanks Tatiana! I figured out what I was doing.  I was not using the correct field to pull the vendor bank account number.  Once I did that, it worked.

  • Community Member Profile Picture
    on at

    Set the questions as resolved so I can get another badges.

    :)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans