Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Answered

How to display Vendor No. on Lot No Information Card

(0) ShareShare
ReportReport
Posted on by 67

Hi all,

I have created an extension page for the Lot No Information card and added a new field to the card for Vendor No.

Lot No Info Card does not have vendor on its table so I need to retrieve it elsewhere. My thought process was use the Lot Info No record to get the associated Item, then use the items table to find the correlated vendor.

pastedimage1671032231075v2.png

I have already attempted to create a record variable to hold the item record, which I would then use to retrieve the Vendor No. but I am stuck trying to figure out the proper methods or functions

pastedimage1671032194227v1.png

  • ERPlatanos Profile Picture
    ERPlatanos 67 on at
    RE: How to display Vendor No. on Lot No Information Card

    Daniele,

    Splendid! That worked! I appreciate your help on this.

    pastedimage1671116070501v1.png

  • Verified answer
    DAnny3211 Profile Picture
    DAnny3211 9,274 Moderator on at
    RE: How to display Vendor No. on Lot No Information Card

    Hi

    Excuse me

    it was my mistake of distraction

    this is the correct code:

    field(50100; vendorid; Code[20])

           {

               Caption = 'vendorid';

               FieldClass=FlowField;

               CalcFormula=lookup(Item. "Vendor No." where ("No."=field("Item No.")));            

           }

    check my answer if it helped you, thanks

    DAniele

  • ERPlatanos Profile Picture
    ERPlatanos 67 on at
    RE: How to display Vendor No. on Lot No Information Card

    Daniele, 

    There is a vendor value for the item

    pastedimage1671114781279v1.png

  • Suggested answer
    DAnny3211 Profile Picture
    DAnny3211 9,274 Moderator on at
    RE: How to display Vendor No. on Lot No Information Card

    hi

    I know I may seem obvious

    but have you checked that the vendor is not valued for that item?

    DAniele

  • ERPlatanos Profile Picture
    ERPlatanos 67 on at
    RE: How to display Vendor No. on Lot No Information Card

    Daniele,

    I appreciate your help so far. I updated the table extension to the code you provided...

    pastedimage1671113490962v1.png

    However, I'm still not seeing anything in the VendorID field..

    pastedimage1671113596138v2.png

    Is there an issue with my page extension code here as well? You can see I have a breakpoint set here, but no breakpoints are getting hit at all in the debugger now. They used to, but I have no idea what changed.

    pastedimage1671113728290v3.png

  • Suggested answer
    DAnny3211 Profile Picture
    DAnny3211 9,274 Moderator on at
    RE: How to display Vendor No. on Lot No Information Card

    Hi

    then you only need to do this

    create a flowfield in join between the lot information and the item with the Item No. field of the item = the Item No. field of the Lot information

    and then show it on the page card

    tableextension 50100 LotNo extends "Lot No. Information"

    {

       fields

       {

           field(50100; VendorID; Code[20])

           {

               Caption = 'VendorID';

               FieldClass=FlowField;

               TableRelation=item."Vendor No." where ("No."=field("Item No."))

           }

       }

    }

    check my answer if it helped you, thanks

    DANiele

  • Suggested answer
    YUN ZHU Profile Picture
    YUN ZHU 77,981 Super User 2025 Season 1 on at
    RE: How to display Vendor No. on Lot No Information Card

    Hi, you should use FlowField (Lookup).

    https://yzhums.com/5802/

    TableRelations is valid when selecting data, and does not automatically bring the value.

    For example,

    https://yzhums.com/22220/

    Hope this helps.

    Thanks.

    ZHU

  • ERPlatanos Profile Picture
    ERPlatanos 67 on at
    RE: How to display Vendor No. on Lot No Information Card

    I found TableRelations are available for this type of process, however I'm unsure still how to find the Vendor ID from the connected Item table.

    I have the following for my table extension...

    pastedimage1671051738771v3.png

    My logic: connect the "Lot No Info" table and "Item" table by item no, then use the relationship to grab Vendor number from Item table to display on the page as "VendorId"...

    pastedimage1671051876017v4.png

    As a result, nothing shows in the field in BC...

    pastedimage1671051924894v5.png

  • ERPlatanos Profile Picture
    ERPlatanos 67 on at
    RE: How to display Vendor No. on Lot No Information Card

    Danny,

    To clarify, on the Lot No Info Card Page, I want a custom field to show the Vendor Number associated with the item used for the Lot No Info Card. 

    pastedimage1671035528343v1.png

    Items cards can have a vendor associated with them, like so...

    pastedimage1671035601695v2.png

    Please disregard the methods I have already tried following the OnAfterGetRecord() trigger. I am new to development and trying everything available that seems logical. Documentation seriously lacks IMO for fairly simple tasks. 

    My thought process was to retrieve the item record from the available item number on the Lot No Info Card. Once I have the item record, I should be able to grab the vendor ID from that record, and set it to a variable for me to use in the custom field.

    Does that thought process make sense?

  • Suggested answer
    DAnny3211 Profile Picture
    DAnny3211 9,274 Moderator on at
    RE: How to display Vendor No. on Lot No Information Card

    Hi

    I don't understand what exactly you want to retrieve?
    do you need the item no?
    haven't you already entered it in a custom field?

    pastedimage1671034859729v1.png

    it's not very clear what you want to achieve

    why do you call it VendorID if it's the Item No

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

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

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 231,407 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans