Options

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

klumklum Member Posts: 102
Hi all,

I try to use trigger Onpush() on menu item? but it doesn't happen anything :( 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

Comments

  • Options
    jemmyjemmy Member Posts: 247
    Strange! :shock:
    I have a very similar code like yours, and it works well.
    The difference is I don't use RECORD.COPY(Record2).
    Try to MESSAGE them...

    Jemmy
  • Options
    jmjm Member Posts: 156
    Hi Klum,

    did you remove the "PushAction" entry in the properties?
    or have you only removed the "RunObject" entry?
    am i right that even the "CONFIRM(Text002)" does not fire?

    br
    Josef Metz
    br
    Josef Metz
  • Options
    klumklum Member Posts: 102
    Hi jemmy and jm,

    Thanks :) I forget to set Source Line No. Field to primary key.

    so 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 \:D/
  • Options
    jemmyjemmy Member Posts: 247
    Yeah... I think you have to remove RECORD.COPY :P
    Table structure has important role.
    Congrats Klum!

    Jemmy
Sign In or Register to comment.