Date Calculation

I added a new field (“Order Expiration Date”)in the Sales Header. This field is actually a formula of SalesHeader.“Posting Date” +14; I am planning to modify all the blank records that have been entered prior the new field was created with the above formula but I got a warning saying that “The date is not valid”. If I changed the formula as SalesHeader.Today +14; there is no error and all the records are correctly updated. Please helps. Thanking you in advance, Panca

You have records with a blank “Posting Date”. It is probably best to Skip these (They will have to be set later). Just watch the Sales Header where the Posting Date is set. I don’t think there is a validate on most of them.

Hi Chris, Unfortunately, there are some validation set to the “Posting Date” (shown below): VALIDATE(“Document Date”,“Posting Date”); VALIDATE(“Shipment Date”,“Posting Date”); What is your suggestion then?

You will have to decide a business rule for this situation. I would think that if the Posting Date is blank then your new field should also be blank. I would tend to agree with Chris that you should skip these records and leave them as blank. F.Y.I Another instance that would give you problems is where “Posting Date” + 14D > 31/12/9999 (the largest date Navision allows)

Create a Report on the Sales Header filter the “Document Type”::Order In the Record Data Item Section If (“Posting Date” <> 0D)AND(“Order Expiration Date” = 0D) THEN BEGIN “Order Expiration Date” := CALCDATE(‘14D’,“Posting Date”); MODIFY; END; [;)]

David Cox’s answer is solved my problem. Thank you guys for the responses. [:D]