Problem in a subform

deepbluedeepblue Member Posts: 152
Hello,

I have a subform based on the Item table. In this subform I should have a field containing the Vendor Name but in the Item table I only have the Vendor No. How could I do it?

Thank you

Answers

  • David_CoxDavid_Cox Member Posts: 509
    If you are a developer, you haven't said?

    Form Designer
    C/AL Globals
    Add Vendor > Record > Vendor
    Add VendName > Text > 50

    C/AL Code
    OnAfterGetRecord()
    CLEAR(VendName);
    IF ("Vendor No." <> '')THEN BEGIN
    IF "Vendor No." <> Vendor."No." THEN
    Vendor.GET("Vendor No.");
    END ELSE
    Vendor.INIT;
    VendName := Vendor.Name;

    Add a column to your list form with the SourceExpr = VendName

    If you have to create a report as well, same code.
    Analyst Developer with over 17 years Navision, Contract Status - Busy
    Mobile: +44(0)7854 842801
    Email: david.cox@adeptris.com
    Twitter: https://twitter.com/Adeptris
    Website: http://www.adeptris.com
  • deepbluedeepblue Member Posts: 152
    Thank you =D> \:D/ :D
Sign In or Register to comment.