Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Unanswered

Lookup trought trigger - Change field value

(0) ShareShare
ReportReport
Posted on by 160

Hi mates :)

I need your help. Mi idea is to change the description value on General Ledger Entries (or create a new one if I can't) depending on the document type.

For example, if Document Type is "Invoice", I want to put the description of the first line of the invoice.

If document type is "Credit Memo", I want to put the desription of the first line of the memo.

I tried something like this but didn't work, could you help me? Thanks :D

pageextension 79130 GeneralLedgerEntries extends "General Ledger Entries"
{
    layout
    {
        addafter("Document No.")
        {
            field("Desc2"; rec.Desc2)
            {
                ApplicationArea = all;
                Caption = 'Desc. Line';
                trigger OnAfterLookup(Selected: RecordRef)
                var
                    Inv: Record "Purch. Inv. Line";
                    CMemo: Record "Purch. Cr. Memo Line";
                begin
                    if rec."Document Type" = 2 then
                        Rec.Desc2 := Inv.Description;
                    if rec."Document Type" = 3 then
                        Rec.Desc2 := CMemo.Description;
                end;
            }
        }
    }

}
  • JMartin Profile Picture
    160 on at
    RE: Lookup trought trigger - Change field value

    Any ideas?

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 294,261 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 233,004 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Product updates

Dynamics 365 release plans