Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Answered

Delivery name and address in vendor account

(0) ShareShare
ReportReport
Posted on by

hi all,

While we creating a Purcahse order, we select a Vendor account and based on vendor account the Delivery name and address got changed.

I have dubugged the Vendor account - Modified method but not able to get the exact place where the Delivery name and address value assigned.

Kindly let me know the exact place where I can get the code for delivery & address.

Please give me more shed on this.

thanks!

  • @rp@n Profile Picture
    @rp@n on at
    RE: Delivery name and address in vendor account

    thanks Mohit, let me check

  • Suggested answer
    Mohit Rampal Profile Picture
    Mohit Rampal 12,554 Super User 2024 Season 1 on at
    RE: Delivery name and address in vendor account

    Yes, for me setAddressFromInventLocationId method is returning Delivery name and address for specific vendor. I am saying it can be other method depending on different data/setup. Therefore, In addition to modifiedField method, add breakpoint on below highlighted methods as well in PurchTable table and debug.

    pastedimage1682431728752v1.png

  • @rp@n Profile Picture
    @rp@n on at
    RE: Delivery name and address in vendor account

    hi Mohit,

    I found below method in PurchTable

    void  setAddressFromVendTable(VendTable _vendTable)
        {
            LogisticsLocation location;
            LogisticsPostalAddress postalAddress = DirParty::primaryPostalAddress(_vendTable.Party);
    
            this.DeliveryName = _vendTable.name();
            if (postalAddress)
            {
                this.DeliveryPostalAddress  = postalAddress.RecId;
                location = LogisticsLocation::find(postalAddress.Location);
                if (location.Description)
                {
                    this.DeliveryName = location.Description;
                }
            }
            else
            {
                this.DeliveryPostalAddress = 0;
            }
            this.AddressRefRecId            = _vendTable.RecId;
            this.AddressRefTableId          = _vendTable.TableId;
        }

    I believe, this code change the Delivery name & address based on Vendor account

    am i right? 

  • @rp@n Profile Picture
    @rp@n on at
    RE: Delivery name and address in vendor account

    Okay, you mean to say the method setAddressFromInventLocationId  is returning the Delivery name  and address for specific vendor account is it?

  • Mohit Rampal Profile Picture
    Mohit Rampal 12,554 Super User 2024 Season 1 on at
    RE: Delivery name and address in vendor account

    Yes, I debugged the code and the values were changing from setAddressFromInventLocationId method. You should put a breakpoint on modifiedField method of PurchTable table and decide which method you need to extend.

  • @rp@n Profile Picture
    @rp@n on at
    RE: Delivery name and address in vendor account

    thanks Mohit,

    modifiedFieldWithUserInput method for OrderAccount field in PurchTable right?

    as you said "it is set on few places based on conditions (you will know when you debug the code)" for example like Purchase order creation and other places also where it got chnaged based on the order account selection

    am i right?

  • Suggested answer
    Mohit Rampal Profile Picture
    Mohit Rampal 12,554 Super User 2024 Season 1 on at
    RE: Delivery name and address in vendor account

    DeliveryName and DeliveryAddress gets modified from ModifiedField method in PurchTable table. You can add breakpoint on modifiedFieldWithUserInput method for OrderAccount field case.

    One of the method where its getting set is from setAddressFromInventLocationId method. (Methods where it can get set are setLocation, setAddressFromVendTable, setAddressFromInventSiteId). 

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Congratulations to the January Top 10 leaders!

Check out the January community rock stars...

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,162 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,962 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans