Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics GP (Archived)

Unhandled script exception: Invalid year '-1' in date function. When accessing Employee PTO Detail

Posted on by Microsoft Employee

Whenever we try to use the PTO manager's Employee PTO Detail we get the following error.

Unhandled script exception: Invalid year '-1' in date function. Script terminated.

EXCEPTION_CLASS_SCRIPT_OUT_OF_RANGE SCRIPT_CMD_SETDATE

It happens right when you try to open the Employee PTO Detail.  It doesn't matter where you try to access it from within GP.  It also doesn't matter which machine is used.  It happens on all workstations and on the main server.  We don't know exactly how long it's been happening since we only use this screen when there is an issue with PTO which rarely happens. I have tried to turn on the debugger and I get the follow additional information, but the log created didn't have anything that stands out to me.  

PTO_Detail_Inquiry_FORM_PRE on form PTO_Detail_Inquiry

Define_Year_DDL of form PTO_Detail_Inquiry

I found other posts that referenced a similar error message and tried all the solutions suggested. (Changing user time, system time, etc..) I didn't have any luck though.  It doesn't seem to be preventing us from using the screen, but we would like to know why it is happening and fix just to be safe.  Any thoughts or suggestions would be greatly appreciated.

*This post is locked for comments

  • Suggested answer
    Terry R Heley Profile Picture
    Terry R Heley Microsoft Employee on at
    RE: Unhandled script exception: Invalid year '-1' in date function. When accessing Employee PTO Detail

    If we run a dex.sql log and just capture the error message this will tell us the problem usually.

    Example of what we have seen in the past would be caused by a date value that cannot be interpreted correctly by the dexterity code used to populate the content of the erring window in Dynamics GP.

    Usually and we can confirm with a log that it will be a CHEKDATE column, in example PTO30100 table.

    Thanks

    Terry Heley

    Microsoft

  • Sherlene Sorenson Profile Picture
    Sherlene Sorenson 965 on at
    RE: Unhandled script exception: Invalid year '-1' in date function. When accessing Employee PTO Detail

    What was the resolution to this?  We are encountering it after an upgrade to GP2018.x

  • Amrapalee Panchal Profile Picture
    Amrapalee Panchal 100 on at
    RE: Unhandled script exception: Invalid year '-1' in date function. When accessing Employee PTO Detail

    Was there any resolution on this one, we are also getting it now on PTO Details inquiry?

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Unhandled script exception: Invalid year '-1' in date function. When accessing Employee PTO Detail

    Hi Bill,

    Did you ever figure this out?  I started getting this error yesterday.

    Thanks!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans