Sales Order Header

kwajahathydrokwajahathydro Member Posts: 88
Hi,

We are using Nav 2009 SG Version, currently I need some help on the sales order header. Under Shipping Tab, there is a field called Shipping Method Code, when I do a lookup on this field, there are no codes inside it. So I have created values like Self Collection and Delivered, my question is how do i stop the whole posting of the sales order if the user doesnt remember to put a value to this field, how do I and where do I and under which code unit or sales table must I write that small peice of code

Regards
KH

Comments

  • anujnagpal21anujnagpal21 Member Posts: 1
    If you want to check this before Releasing the Document then

    Put a TESTFIELD at the Release option on Push trigger in Function Menu Button
    TESTFIELD("Shipment Method Code");
    ReleaseSalesDoc.PerformManualRelease(Rec);
    

    This will do the thing.

    In the same way if you want to check this while posting then
    TESTFIELD("Shipment Method Code");
    IF ApprovalMgt.PrePostApprovalCheck(Rec,PurchaseHeader) THEN BEGIN
      IF ApprovalMgt.TestSalesPrepayment(Rec) THEN
        ERROR(STRSUBSTNO(Text001,"Document Type","No."))
      ELSE BEGIN
        IF ApprovalMgt.TestSalesPayment(Rec) THEN
          ERROR(STRSUBSTNO(Text002,"Document Type","No."))
        ELSE
          CODEUNIT.RUN(CODEUNIT::"Sales-Post (Yes/No)",Rec);
      END;
    END;
    
Sign In or Register to comment.