web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
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

I have the same question (0)
  • Suggested answer
    Nitin Verma Profile Picture
    21,812 Moderator on at

    Hi,

    you can compare your Document type like beow

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

  • JMartin Profile Picture
    160 on at

    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
    Vaishnavi J Profile Picture
    3,096 on at

    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

  • Suggested answer
    Nitin Verma Profile Picture
    21,812 Moderator on at

    What else you are looking for?

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,050 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,351 Super User 2026 Season 1

#3
Grigorios Mavrogeorgis Profile Picture

Grigorios Mavrogeorgis 1,200 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans