如何在2009版中跳过函数



我有一个功能,你可以添加文章。我有一个日期范围。但是如果它不在日期范围内,我想跳过这个函数(表36):

FncCheckBOM(Description : Text[30])
LocRecSalesLine.SETRANGE("Document Type", Rec."Document Type");
LocRecSalesLine.SETRANGE("Document No.", Rec."No.");
LocRecSalesLine.SETRANGE(Type,LocRecSalesLine.Type::Item);
LocRecSalesLine.SETFILTER("BOM Item No.", '');
LocRecSalesLine.SETFILTER("Description 2", '*'+Description+'*');
LocRecSalesLine.SETFILTER("Purch. Order Line No.", '0');
LocRecSalesLine.SETFILTER("Job Contract Entry No.", '0');
IF LocRecSalesLine.FINDFIRST THEN
  REPEAT
  BEGIN
    FromBOMComp.SETRANGE("Parent Item No.",LocRecSalesLine."No.");
    NoOfBOMComp := FromBOMComp.COUNT;
    IF (NoOfBOMComp <> 0) AND (LocRecSalesLine."BOM Item No." = '') THEN
    BEGIN
      LocRecSalesLine.FncExplodeBOM;
    END;
  END
  UNTIL LocRecSalesLine.NEXT = 0;
LocRecSalesLine.RESET;
LocRecSalesLine.SETRANGE("Document Type", Rec."Document Type");
LocRecSalesLine.SETRANGE("Document No.", Rec."No.");
LocRecSalesLine.SETRANGE(Type,LocRecSalesLine.Type::" ");
LocRecSalesLine.SETFILTER("Description 2", '*'+Description+'*');
IF LocRecSalesLine.FINDFIRST THEN
  REPEAT
    LocRecSalesLine.DELETE;
  UNTIL LocRecSalesLine.NEXT = 0;
//AddItemDates.CheckDates(BeginDate, EndDate);
COMMIT;

我的方法是这样的(表50012):

BetginDatumMessage := 'begindatum is yessss:';
 Rec.SETRANGE("Parent Item No.","Parent Item No.");
 IF Rec.FIND() THEN;
  //Rec.SETRANGE("Parent Item No.","Parent Item No.");
  //Rec.SETRANGE("Item No.","Item No.");
  MESSAGE('Date is ok');
  //BeginDate := TODAY + 1 ;
  //EndDate := TODAY + 2;
   MESSAGE(BetginDatumMessage + '' + FORMAT(Rec.BeginDate));
   MESSAGE(FORMAT(TODAY));
   IF (TODAY >= Rec.BeginDate) AND (TODAY <= Rec.EndDate) THEN BEGIN
   MESSAGE('Dat is fine');
    RecSalesHeaderQuote.FncCheckBOM(SalesLines.Description);
    MESSAGE(FORMAT(BeginDate));
    MESSAGE(SalesLines.Description);
  END
  ELSE BEGIN
  MESSAGE('other');
  END;

因为现在它总是触发函数:FncCheckBOM(Description : Text[30])

不可以的

谢谢

BetginDatumMessage := 'begindatum is yessss:';
 Rec.SETRANGE("Parent Item No.","Parent Item No.");
 IF Rec.FIND() THEN;
  MESSAGE('Date is ok');
   IF (TODAY >= Rec.BeginDate) AND (TODAY <= Rec.EndDate) THEN BEGIN
   MESSAGE('Dat is fine');
    RecSalesHeaderQuote.FncCheckBOM(SalesLines.Description);
    MESSAGE(FORMAT(BeginDate));
    //MESSAGE(SalesLines.Description);
  END
  ELSE BEGIN
  EXIT;
  MESSAGE('other');
  END;
   IF (Rec.BeginDate = 0D) AND (Rec.EndDate = 0D ) THEN BEGIN
    MESSAGE('Empty');
  END;

to SKIP你的函数上你想放的那部分代码的句子:

EXIT;

该语句将使你的方法结束并退出函数。

相关内容

  • 没有找到相关文章

最新更新