Calculation more Request Order

Hi Everybody.

On Purchase Line of my include more Request Order. I want calculation Amount on all Request. But wrong.

This procedure only calculates 1 line. It can not repeat for the remaining lines by conditional :

RecRequisition.SETRANGE("Requisition No",RecPurchLine."Requisition No");

RecRequisition.RESET;
RecRequisition.SETRANGE("Requisition No",RecPurchLine."Requisition No");
IF RecRequisition.FIND('+') THEN BEGIN
  REPEAT
    RecRequisition.SETRANGE("Requisition No",RecPurchLine."Requisition No");
    RecRequisition.CALCSUMS(Amount);
    PRAmount:=RecRequisition.Amount;
  UNTIL RecRequisition.NEXT=0   ;
END;
MESSAGE(Txt0001,PRAmount);

Please help me fix code. Thanks so much

Best Regards,

Dinh Son

Parents
No Data
Reply
  • Hi Dinh,

    What table is RecRequisition? And exactly what is it, that you're trying to calculate?

    The second "RecRequisition.SETRANGE("Requisition No",RecPurchLine."Requisition No");" line certainly does not make anything for your code. It's just repeating a line.

Children
No Data
Related
Recommended