Options

Adding validation in Purchase Order

Hello All,

Is it possible to add validation in Purchase Order, if GRN Posted on particular Purchase Order then the system should not be allowed to reopen or modify Purchase Order.

Thanks in advance.

Best Answer

  • Options
    Sachin_Sachin_ Member Posts: 67
    edited 2019-06-24 Answer ✓
    Hello Sandeep,

    Yes it is possible In development environment Just go to purchase order page in the action page go to reopen trigger in that write the below code

    PurchLine.Reset;
    PurchLine.SETRANGE("Document No","No");
    IF PurchLine.FindSet then Repeat
    if PurchLine."Quantity Received"<>0 then
    Error('You Cannot Reopen or Modify Purchase order');
    UNTIL PurchLine.Next=0;

    Regards,
    Sachin

Answers

  • Options
    Sachin_Sachin_ Member Posts: 67
    edited 2019-06-24 Answer ✓
    Hello Sandeep,

    Yes it is possible In development environment Just go to purchase order page in the action page go to reopen trigger in that write the below code

    PurchLine.Reset;
    PurchLine.SETRANGE("Document No","No");
    IF PurchLine.FindSet then Repeat
    if PurchLine."Quantity Received"<>0 then
    Error('You Cannot Reopen or Modify Purchase order');
    UNTIL PurchLine.Next=0;

    Regards,
    Sachin
  • Options
    Sandeep_Sandeep_ Member Posts: 2
    @Sachin_ Thanks Bud it worked for me.
  • Options
    Sachin_Sachin_ Member Posts: 67
    Cheers Mate Glad it Worked!
Sign In or Register to comment.