Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Microsoft Dynamics GP (Archived)

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

(0) ShareShare
ReportReport
Posted on by

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
    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
    967 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
    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
    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

Jainam Kothari – Community Spotlight

We are honored to recognize Jainam Kothari as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > 🔒一 Microsoft Dynamics GP (Archived)

#1
Almas Mahfooz Profile Picture

Almas Mahfooz 3 User Group Leader

Featured topics

Product updates

Dynamics 365 release plans