I try to use trigger Onpush() on menu item?

Hi all, I try to use trigger Onpush() on menu item? but it doesn’t happen anything :frowning: what i do wrong? With this code IF NOT CONFIRM(Text002) THEN EXIT; IF PurchLineRec.FIND(’-’) THEN REPEAT InspecEntry.COPY(PurchLineRec); InspecEntry.“Document Type” := PurchLineRec.“Document Type”; InspecEntry.“Document No.” := PurchLineRec.“Document No.”; InspecEntry.“Source Line No.” := PurchLineRec.“Line No.”; InspecEntry.“Item No.” := PurchLineRec.“No.”; InspecEntry.Quantity := PurchLineRec.Quantity; InspecEntry.“Unit of Measure” := PurchLineRec.“Unit of Measure”; InspecEntry.“Inspection at Location” := PurchLineRec.“Location Code”; InspecEntry.INSERT; UNTIL PurchLineRec.NEXT = 0; where i should to set more? I need to copy some field from purchase Line to new table called Inspection Entries Thank in advance klum

I think this codes is not used : InspecEntry.COPY(PurchLineRec); just : Inspecentry.init; … Inspecentry.insert; Have you tried it?

I think this codes is not used : InspecEntry.COPY(PurchLineRec); just : Inspecentry.init; … Inspecentry.insert; Have you tried it?

I think this codes is not used : InspecEntry.COPY(PurchLineRec); just : Inspecentry.init; … Inspecentry.insert; Have you tried it?

Debugger should help you

Arnoldus, thanks I try to change some thing like this IF PurchLineRec.FIND(’-’) THEN REPEAT InspecEntry.INIT; InspecEntry.“Source Table No.” := 39; InspecEntry.“Document Type” := PurchLineRec.“Document Type”; InspecEntry.“Document No.” := PurchLineRec.“Document No.”; InspecEntry.“Source Line No.” := PurchLineRec.“Line No.”; InspecEntry.“Source Inspection Type” := InspecEntry.“Source Inspection Type”::Purchase; InspecEntry.“Item No.” := PurchLineRec.“No.”; InspecEntry.Quantity := PurchLineRec.Quantity; InspecEntry.“Unit of Measure” := PurchLineRec.“Unit of Measure”; InspecEntry.“Inspection at Location” := PurchLineRec.“Location Code”; InspecEntry.INSERT; UNTIL PurchLineRec.NEXT = 0; MESSAGE(Text002); It work now :slight_smile: