Purch. Receipt Lines cannot close because the system is currently running...

Hi Forum,

I got the following error message when trying to copy items from Purch. Receipt Line to Transfer Line
“Purch. Receipt Lines cannot close because the system is currently running……”

Here is what I’ve done:

  1. I created new form (F50085) to display Purch. Receipt Line.”Expected Receipt Date” > TODAY

  2. Embedded F50085 in Form Transfer Order (F5740) → Function MenuItem (RunObject F50085)

  3. I got the above error message after hitting the OK commandbutton.

On Push() I added the following codes:

FromPurchRcptLine.RESET;

FromPurchRcptLine.COPY(Rec);

CurrForm.SETSELECTIONFILTER(FromPurchRcptLine);

IF FromPurchRcptLine.FIND(’-’) THEN BEGIN

REPEAT

NextLineNo := NextLineNo + 10000;

TransferLine.INIT;

TransferLine.“PO No.” := FromPurchRcptLine.“Document No.”;

TransferLine.“Item No.” := FromPurchRcptLine.“No.”;

TransferLine.“Line No.” := NextLineNo;

TransferLine.“Variant Code” := FromPurchRcptLine.“Variant Code”;

TransferLine.Quantity := FromPurchRcptLine.Quantity;

TransferLine.“Unit of Measure” := FromPurchRcptLine.“Unit of Measure Code”;

TransferLine.“Container/Shpt Release No.” := FromPurchRcptLine.“Container No.”;

TransferLine.INSERT;

UNTIL FromPurchRcptLine.NEXT = 0;

END;

Can someone help me please?

Thanks
ZB

So, to be clear, you’ve added this code to the OnPush trigger of the OK command button? If so, then I suspect that that’s your problem. By putting your code there you are, at the same time, telling the form to run code and close. That’s what clicking the OK button does by default.

To solve the problem, create a new command button and put this custom code in the OnPush trigger for that new control. Should solve the problem.

Hi George,

It works GREAT.Thank you very much for your helps!

ZB