Function Call Issue

LambaLamba Member Posts: 260
Hi,
As all know there is a Change Status function on Order, that works for individual order.
I have created a new list page,on which the status must change from Firm planned to Released, for the Order lines which are marked as True.

but when i call the std function it works for all available lines neglecting the setrange.
"To Release" is a boolean, the Change Status functionality must work for the lines marked true.

Code on OnAction trigger:

RecProdOrder.RESET;
RecProdOrder.SETRANGE(RecProdOrder."To Release",TRUE);
//***MESSAGE('RecProdOrder.Mark - %1',RecProdOrder."To Release");
IF RecProdOrder.FINDSET THEN BEGIN
REPEAT
CODEUNIT.RUN(5407,RecProdOrder);
UNTIL RecProdOrder.NEXT=0;
END;

Answers

  • LambaLamba Member Posts: 260
    I was missing a filter, :( , now its working with following code:


    RecProdOrder.RESET;
    RecProdOrder.SETRANGE(RecProdOrder.Status,RecProdOrder.Status::"Firm Planned");
    RecProdOrder.SETRANGE("To Release",TRUE);
    IF RecProdOrder.FINDSET THEN BEGIN
    REPEAT
    CODEUNIT.RUN(5407,RecProdOrder);
    UNTIL RecProdOrder.NEXT=0;
    END;
Sign In or Register to comment.