Hi, When you’re on a released sales order (SO) form. You can change the posting date on the header. When I try to de the same from code : VALIDATE of the posting date + MODIFY. I run into the OnValidate trigger of the PaymentDiscount % trigger. There you can see the code : IF CurrFieldNo <> FIELDNO(“Posting Date”) THEN TESTFIELD(Status,Status::Open); So from a form the CurrfieldNo = 20, while from code CurrfieldNo = 0, thereby giving the error that the SO should be open. I tried calling the SetPostingDate function in codeunit 80, but that doesn’t seem to help. Q1 : is there a way to do the validate of the posting date on a released SO from code ? Q2 : Why is Navision not allowing the change from code, while you can change it from a form ? Thanks and bye for now.
quote:
Q1 : is there a way to do the validate of the posting date on a released SO from code ?
You could assign the new date without validation or temporary set the status to open before validation … Regards, Jörg