AL icon indicating copy to clipboard operation
AL copied to clipboard

Add OnBefore/After- Lookup, Drilldown, NewRecord event support for page extensions

Open Anna-Gudimova opened this issue 8 years ago • 9 comments

image

In case the image above doesn't load here's the code snippet:

pageextension 60089 "TRG General Journal" extends "General Journal" { layout {
modify(CurrentJnlBatchName) { trigger OnLookup(); begin OnSetBatchReversalDateEvent(Rec,ReversalDate); end;

            trigger OnValidate();
            begin
                OnSetBatchReversalDateEvent(Rec,ReversalDate); 
            end;
        }
        modify(Amount)
        {
            trigger OnValidate();
            begin
                SAVERECORD(); 
            end;
        }
  }

}

Error Message: OnLookup is not a valid trigger/ OnValidate is not a valid trigger. Is there a way to add code/functions/publishers to the page triggers of the native fields?

Anna-Gudimova avatar Jul 31 '18 16:07 Anna-Gudimova

Currently you can only add code before or after the OnValidate trigger by using OnAfterValidate and OnBeforeValidate triggers:

modify("Cause Of Absence Filter") 
{
            trigger OnAfterValidate() 
            begin
            end;
}

You can always see the available triggers by pressing Ctrl + Space (IntelliSense) after the trigger keyword.

StanislawStempin avatar Aug 01 '18 10:08 StanislawStempin

Will access to those field triggers be added at some point though? I need to put code on Lookup, Drilldown, OnNewRecord and other native page and page triggers that aren't available now.

Anna-Gudimova avatar Aug 01 '18 18:08 Anna-Gudimova

@Anna-Gudimova OnNewRecordEvent does exist, like here on Purchase Prices page: OnNewRecordEvent(VAR Rec : Record "Purchase Price"; BelowxRec : Boolean; VAR xRec : Record "Purchase Price") But OnlookUp publishers doesn't exist yet ... And we need them too (from table/page).

BertDeTemmerman avatar Aug 02 '18 09:08 BertDeTemmerman

Possibility of handle OnLookup event is a need. There are tons of customization here (opening custom lookup pages, applying filters and so on).

demiliani avatar Aug 06 '18 13:08 demiliani

hi Stanislaw, what's the status on any generic native OnValidate/OnBeforeValidate/OnAfterValidate events for pages and tables? This would save you a lot of new in-code-events you are currently creating for my colleagues ;)

Table Event Publisher image

Page Event Publisher image

PageExtension Modification image

Walwode avatar Aug 23 '18 14:08 Walwode

Any news on this?

SergioKelly avatar Jan 07 '19 19:01 SergioKelly

any update on the issue?

gntpet avatar Nov 13 '19 13:11 gntpet

pageextensions now have triggers for OnAfterValidate(), OnAssistEdit(), OnBeforeValidate(), OnDrillDown(), and the much-discussed OnLookup().

Is there anything else still needed here? If so, what is it? The discussion is long and not that clear.

dzzzb avatar Jan 28 '21 12:01 dzzzb

Let's close this issue as most of the triggers have been added. For any new triggers, please go to BCIdeas

atoader avatar Mar 07 '21 14:03 atoader