我有一个可以添加文章的功能。 我有一个日期范围。但如果它不在日期范围内,我想跳过这个功能(表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;
答案 0 :(得分:1)
到 SKIP 你想要放入sentecen代码的功能:
EXIT;
此语句将使您的方法结束并退出该函数。