Problem Importing Values into Purchase Line Date Fields

ginabginab Member Posts: 3
I wrote a little app for a customer that imports Purchase Orders into Navision from another system they have. Everything seems to be working ok except the Planned Receipt Date, Expected Receipt Date, and Order Date fields in the Purchase Line table are throwing an error.

After importing the PO, the user opens Navision, the user navigates the record, and then the user attempts to edit the Planned Receipt Date, Expected Receipt Date, or the Order field and receives this error:
The date formula ‘+0’ should include a time unit.
Time Units can be: D, WD, W, M,Q,or Y.
C, meaning current time unit based on date, can be specified as a prefix to the time unit.

I am not sure what is going on here because when I import values for these fields they are dates. Sql will not let you enter anything but a date for a date/time field. If I view record in enterprise manager everything is cool. But when viewed from Navision is not so cool.

I am obviously missing something. But what? Is this formula looking for a value in another field maybe? If anyone can lend a clue it would be appreciated. Thanks for your time!

Comments

  • DaveTDaveT Member Posts: 1,039
    Hi ginab,

    I would suspect that you set the Lead Time Calculation or Safety Lead Timefield to '0' - this is a dateformula type field and should be initialized to blank or 0D.

    The check the defaults post a manual PO and Zoom (F8 ) on the record to see the defaults from your setup.
    Dave Treanor

    Dynamics Nav Add-ons
    http://www.simplydynamics.ie/Addons.html
  • BBlueBBlue Member Posts: 90
    I assume you import your purchase order data at SQL level...

    I agree with Dave concerning the "Lead Time Calculation" and "Safety Lead Time" fields. If you will look at the OnValidate triggers of "Order Date", "Planned Receipt Date", "Expected Receipt Date" in table 39 you will see that there are some references to the above mentioned dateformula fields, and if they contain wrong values the system gives the errors mentioned whrn trying to modify the date fields.

    I would suggest though to import your PO at NAV level instead through dataport or something, this way you can control the data inserted.
    //Bogdan
  • ginabginab Member Posts: 3
    It was the Safety Lead Time field. I was setting it to 0 instead of blank. Thanks so much!
  • DaveTDaveT Member Posts: 1,039
    Hi Ginab,

    Gald to help :mrgreen:
    Dave Treanor

    Dynamics Nav Add-ons
    http://www.simplydynamics.ie/Addons.html
Sign In or Register to comment.