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...
Suggested answer

New column with first line description - Vendor Ledger Entries

(0) ShareShare
ReportReport
Posted on by 160

Hi mates

It's me again! Need your help.

I created a new column (Custom Description) on Vendor Ledger Entry table and Vendor Ledger Entries page.

Now, I want that this new column show the first line of description depending on document type (or not)

I tried the next on Table:

        field(79003; "Custom Description"; Text[100])
        {
            Caption = 'Custom Description';
            Editable = false;

            // FieldClass = FlowField;
            // CalcFormula = lookup("Purch. Inv. Line".Description where("Document No." = field("Document No.")));
        }

Ignore the bars please. Whit that, I only have Purch. Inv. Line description.

The next I tried was (on Page) to classify by serial number because I can't compare Enum (Document Type) like String:

pastedimage1655367469943v1.png -> Operator '=' cannot be applied to operands of type 'Enum "Gen. Journal Document Type"' and 'Text'

     
    var
        CustDescFac: Record "Purch. Inv. Line";
        CustDescAb: Record "Purch. Cr. Memo Line";

    trigger OnAfterGetRecord()

    Begin
        if SerialNumber = 'C-FAC+' then
            CustDescFac.Description := Rec."Custom Description";
        if SerialNumber = 'C-AB' then
            CustDescAb.Description := Rec."Custom Description";

    end;

And need something that check or put every line.

Any ideas?

Thank you so much! :D

  • Suggested answer
    Nitin Verma Profile Picture
    21,569 Moderator on at
    RE: New column with first line description - Vendor Ledger Entries

    What else you are looking for?

  • Suggested answer
    Vaishnavi J Profile Picture
    3,060 on at
    RE: New column with first line description - Vendor Ledger Entries

    Hi,

    if you have written the above logic on separate page and not page extension you can write the below logic.

    Also in the page you have to give the permission to modify the posted tables. Refer the screenshot.

    Permission = tabledata "Purch. Inv. Line" =rim, tabledata "Purch. Cr. Memo Line"=rim;

    pastedimage1655388890995v1.png

      var

          CustDescFac: Record "Purch. Inv. Line";

          CustDescAb: Record "Purch. Cr. Memo Line";

      trigger OnAfterGetRecord()

      Begin

          if rec."Document Type" = Rec."Document Type"::Invoice then

              CustDescFac.Validate(Description, Rec."Custom Description");

              CustDescFac.modify(true);

          if rec."Document Type" = Rec."Document Type"::Refund then

              CustDescAb.Validate(Description,Rec."Custom Description");

              CustDescAb.modify(true);

      end;

    Also can you describe how are you going to fill the value on this custom field in VLE?

    If my answer was helpful to you, please verify it so that other users know it worked. Thank you very much

  • JMartin Profile Picture
    160 on at
    RE: New column with first line description - Vendor Ledger Entries

    Thanks mate :) One problem solved but still not working :(

       var

           CustDescFac: Record "Purch. Inv. Line";

           CustDescAb: Record "Purch. Cr. Memo Line";

       trigger OnAfterGetRecord()

       Begin

           if rec."Document Type" = Rec."Document Type"::Invoice then

               CustDescFac.Description := Rec."Custom Description";

           if rec."Document Type" = Rec."Document Type"::Refund then

               CustDescAb.Description := Rec."Custom Description";

       end;

  • Suggested answer
    Nitin Verma Profile Picture
    21,569 Moderator on at
    RE: New column with first line description - Vendor Ledger Entries

    Hi,

    you can compare your Document type like beow

    if Rec."Document Type" = Rec."Document Type"::Invoice then

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

Ramesh Kumar – Community Spotlight

We are honored to recognize Ramesh Kumar as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
Sohail Ahmed Profile Picture

Sohail Ahmed 2,655

#2
Mansi Soni Profile Picture

Mansi Soni 1,574

#3
YUN ZHU Profile Picture

YUN ZHU 1,453 Super User 2025 Season 1

Featured topics

Product updates

Dynamics 365 release plans