converting 2009NAV object to NAV2016

mdsrmdsr Member Posts: 163
edited 2019-08-27 in NAV Three Tier
Hi experts,
I want to design a table based on 2009 nav TABLE object.can any one know how to do that code as follows
OBJECT Table 50005 Purchase QC Header
{
  OBJECT-PROPERTIES
  {
    Date=17-02-16;
    Time=11:51:55;
    Modified=Yes;
    Version List=
  }
  PROPERTIES
  {
    OnInsert=BEGIN
               IF "QC Test Certificate No." = '' THEN BEGIN
                 InventorySetup.GET;
                 InventorySetup.TESTFIELD(InventorySetup."QC Test Certificate No.");
                 //NoSeriesMgt.GetNextNo(InventorySetup."QC Test Certificate No.",TODAY,TRUE);
                 NoSeriesMgt.InitSeries(InventorySetup."QC Test Certificate No.",xRec."No. Series",0D,"QC Test Certificate No.","No. Series");
               END;
             END;

    LookupFormID=Form50012;
  }
  FIELDS
  {
    { 1   ;   ;GRN No.             ;Code20        ;TableRelation="Purch. Rcpt. Line";
                                                   OnValidate=BEGIN
                                                                TESTFIELD("QC Tested Lines",0);
                                                                PurchRecptHeader.GET("GRN No.");
                                                                varGRNNo:=PurchRecptHeader."No.";
                                                                "Vendor No." := PurchRecptHeader."Buy-from Vendor No.";
                                                                "Vendor Name" := PurchRecptHeader."Buy-from Vendor Name";
                                                                "Location Code" := PurchRecptHeader."Location Code";
                                                                "Posting Date" := PurchRecptHeader."Posting Date";
                                                                "Vendor Shipment No":=PurchRecptHeader."Vendor Shipment No.";
                                                                "QC Creation Date" := WORKDATE;

                                                                PurchRecptLine.RESET;
                                                                //PurchRecptLine.SETRANGE(PurchRecptLine."Document No.","GRN No.");
                                                                PurchRecptLine.SETRANGE(PurchRecptLine."Document No.",varGRNNo);
                                                                PurchRecptLine.SETRANGE(PurchRecptLine.Type,PurchRecptLine.Type::Item);
                                                                PurchRecptLine.SETFILTER(PurchRecptLine.Quantity,'>0',0);
                                                                PurchRecptLine.SETRANGE(PurchRecptLine."QC Needed",TRUE);
                                                                PurchRecptLine.SETRANGE(PurchRecptLine."QC Tested",FALSE);
                                                                IF PurchRecptLine.FINDSET THEN
                                                                BEGIN
                                                                REPEAT
                                                                  PurchaseQCLine.INIT;
                                                                  PurchaseQCLine."QC Test Certificate No." := "QC Test Certificate No.";
                                                                  PurchaseQCLine."GRN No." := "GRN No.";
                                                                  PurchaseQCLine."Line No."  := PurchRecptLine."Line No.";
                                                                  PurchaseQCLine."Item No." := PurchRecptLine."No.";
                                                                  PurchaseQCLine.Description := PurchRecptLine.Description;
                                                                  PurchaseQCLine.Quantity := PurchRecptLine.Quantity;
                                                                  PurchaseQCLine."QC Accepted Qty":=PurchRecptLine.Quantity;
                                                                  PurchaseQCLine."Location Code" := PurchRecptLine."Location Code";
                                                                  PurchaseQCLine.INSERT;
                                                                UNTIL PurchRecptLine.NEXT = 0;
                                                                END
                                                                ELSE
                                                                   ERROR('There are no QC result to be tested');
                                                              END;
                                                               }
   

Answers

  • mdsrmdsr Member Posts: 163
    { 2   ;   ;Vendor No.          ;Code20        ;TableRelation="Purch. Rcpt. Line"."Buy-from Vendor No." WHERE (Document No.=FIELD(GRN No.));
                                                       Editable=No }
        { 3   ;   ;Posting Date        ;Date          ;Editable=No }
        { 4   ;   ;QC Creation Date    ;Date           }
        { 5   ;   ;Vendor Name         ;Text50        ;Editable=No }
        { 6   ;   ;No. of Lines        ;Integer       ;FieldClass=FlowField;
                                                       CalcFormula=Count("Purch. Rcpt. Line" WHERE (QC Needed=FILTER(Yes),
                                                                                                    Document No.=FIELD(GRN No.),
                                                                                                    Quantity=FILTER(>0)));
                                                       Editable=No }
        { 7   ;   ;QC Tested Lines     ;Integer       ;FieldClass=FlowField;
                                                       CalcFormula=Count("Purch. Rcpt. Line" WHERE (QC Tested=FILTER(Yes),
                                                                                                    Document No.=FIELD(GRN No.)));
                                                       Editable=No }
        { 8   ;   ;QC Test Certificate No.;Code20     ;OnValidate=BEGIN
                                                                    IF "QC Test Certificate No." <> xRec."QC Test Certificate No." THEN BEGIN
                                                                      InventorySetup.GET;
                                                                      NoSeriesMgt.TestManual(InventorySetup."QC Test Certificate No.");
                                                                      "No. Series" := '';
                                                                    END;
                                                                  END;
                                                                   }
        { 9   ;   ;Location Code       ;Code10        ;TableRelation=Location;
                                                       Editable=Yes }
        { 10  ;   ;No. Series          ;Code20         }
        { 11  ;   ;Status              ;Option        ;OptionCaptionML=ENU=Open,Finished;
                                                       OptionString=Open,Finished;
                                                       Editable=No }
        { 12  ;   ;Vendor Shipment No  ;Text30         }
      }
      KEYS
      {
        {    ;QC Test Certificate No.                 ;Clustered=Yes }
        {    ;Vendor No.,GRN No.,Posting Date          }
      }
      FIELDGROUPS
      {
      }
      CODE
      {
        VAR
          PurchRecptLine@1000000000 : Record 121;
          PurchRecptHeader@1000000001 : Record 120;
          InventorySetup@1000000002 : Record 313;
          NoSeriesMgt@1000000003 : Codeunit 396;
          PurchaseQCHeader@1000000004 : Record 50005;
          PurchaseQCLine@1000000005 : Record 50006;
          varGRNNo@1000000006 : Code[20];
    
        PROCEDURE AssistEdit@1000000000() : Boolean;
        BEGIN
          InventorySetup.GET;
          InventorySetup.TESTFIELD(InventorySetup."QC Test Certificate No.");
          IF NoSeriesMgt.SelectSeries(InventorySetup."QC Test Certificate No.",xRec."No. Series","No. Series") THEN BEGIN
            NoSeriesMgt.SetSeries("QC Test Certificate No.");
            EXIT(TRUE);
          END;
        END;
    
        BEGIN
        END.
      }
    }
    
Sign In or Register to comment.