how to update the record when the form open?

Oneway
Oneway Member Posts: 53
hi, all

i'd like to validate the posting date as work date when i open a sales order. i tried several times but failure.

could your guys give me some hint?

Comments

  • Savatage
    Savatage Member Posts: 7,142
    A simple solution would be to add following lines in the OnAfterGetCurrRecord-trigger of the Sales Order form:
    IF "Posting Date" <> "Work Date" THEN
      "Posting Date" := "Work Date";
    

    I slightly changed it from
    http://www.mibuso.com/forum/viewtopic.php?t=7844
  • Oneway
    Oneway Member Posts: 53
    actually, i would like validate the posting date to cause the system change the due date automaticly.

    yes, i tried the onaftergetcurrrecord but unsuccessfully
  • David_Singleton
    David_Singleton Member Posts: 5,479
    Keep in mind that in Navision, you should NEVER make changes to Business logic at the form level. You should think this through carefully, and preferable look at the posting routines as a more logical place to do this.

    Always keep in mind though tax calculation dates, order planning, due dates, Released vs open etc.
    David Singleton