Modify Posting Date

slmaluwaslmaluwa Member Posts: 366
hi
When making Sales Orders, the posting date is recorded as WORKDATE. But, in some instances, the user try to post it after few days of creating the order.
I am trying to modify the Posting Date to current date at the time posting in Sales Order "Post".
Here is what I do
1. If the Posting Date is different, ask the user whether would like to change
2. If yes, I do
Posting Date := TODAY;
VALIDATE("Posting Date");
Shipment Date := TODAY;
VALIDATE("Shipment Date");
MODIFY
and then carry on the posting. and it is seems to be working.

Can some experts tell me whether I am doing the current way? Is there any thing else to do?

TIA

Maluwa
"A bove maiore discit arare minor"-"From the old ox, the young one learns to plow."

Comments

  • Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    Another approach is to simply make the Posting Date blank when it's different from the current date.

    On the form (order, invoice, etc.) you could put this code:
    IF "Posting Date" <> TODAY THEN
      "Posting Date" := 0D;
    
    You don't write this to the database! Only the value on the form is changed. When the users wants to post this order, the standard error message is displayed because the Posting Date is blank. Now the user has to fill in the field, before he can post the document.

    Note that in NAV 5.0 SP1, one has a new option to have this Posting Date filled in or not by default in Sales & Purchase documents.
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
  • slmaluwaslmaluwa Member Posts: 366
    hi Luc
    In our case, we have already disabled editing the Posting Date for some other reasons.
    So, user cannot change it by typing it.

    by the way, I hope my method mention above is correct. What will happen when I change this info for a partially posted Order?
    "A bove maiore discit arare minor"-"From the old ox, the young one learns to plow."
  • vanrofivanrofi Member Posts: 272
    It will not change the previous posted shipment or invoice, so don't worry about partially posted.
    Anyway, where did you put your code? CU80? Just make sure that all functionality still works (manual invoice, batch posting, inventory Pick posting,...) normally same process is passed, but better check it out!

    You did not get any message on order-status while modifying the record?

    I'rm not a programmer, but VALIDATE("Posting Date",today); should work also.


    Succes!
Sign In or Register to comment.