Skip to main content

Notifications

Dynamics 365 Community / Forums / Field Service forum / How to get vendor code...
Field Service forum

How to get vendor code and vendor address in form using lookup method in D365FO.

Posted on by 630

Hi Experts,

In transfer order form we want to get vendor code and vendor address using lookup method. I am avail to get vendor code but i want to get vendor address also in D365FO.

Please tell me how to get vendor address in lookup.

Thanks & Regards

Rahul.

  • Rahul.p Profile Picture
    Rahul.p 630 on at
    RE: How to get vendor code and vendor address in form using lookup method in D365FO.

    Dear Mohsin,

    Vend account is coming from VandTable and Vendor address is coming from DirPartyPostalAddressView. These are the two different tables, so how to join these two tables and display the vendor code base on vendor address in lookup field.

    Thanks and Regards,

    Rahul.

     

  • Mohsin Ali Profile Picture
    Mohsin Ali 3,610 on at
    RE: How to get vendor code and vendor address in form using lookup method in D365FO.

    this might help you:

    http://www.axaptapedia.com/SysTableLookup_class

  • Rahul.p Profile Picture
    Rahul.p 630 on at
    RE: How to get vendor code and vendor address in form using lookup method in D365FO.

    Dear Mohsin,

    Thank's for your reply.

    Using of below code i am getting the vendor code.

    /// <param name="e"></param>
    [FormControlEventHandler(formControlStr(InventTransferOrders, InventTransferTable_IBC_ShipTo), FormControlEventType::Lookup)]
    public static void InventTransferTable_ABC_ShipTo_OnLookup(FormControl sender, FormControlEventArgs e)
    {
    Query query = new Query();
    QueryBuildDataSource queryBuildDataSource;
    QueryBuildRange queryBuildRange;

    SysTableLookup sysTableLookup = SysTableLookup::newParameters(tableNum(VendTable), sender);

    sysTableLookup.addLookupField(fieldNum(VendTable, AccountNum));
    sysTableLookup.addLookupField(fieldNum(VendTable, VendGroup));

    queryBuildDataSource = query.addDataSource(tableNum(VendTable));

    //queryBuildRange = queryBuildDataSource.addRange(fieldNum(CustTable, CustGroup));
    // queryBuildRange.value('40');

    sysTableLookup.parmQuery(query);

    sysTableLookup.performFormLookup();

    Could you please give me vendor address code also because vendor address is coming from another table.

    Thanks & Regards

    Rahul.

  • Mohsin Ali Profile Picture
    Mohsin Ali 3,610 on at
    RE: How to get vendor code and vendor address in form using lookup method in D365FO.

    You need to update Lookup view of Vendor and add Vendor Code and Vendor Address fields.

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,240 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans