Not Valid Date

hant
hant Member Posts: 115
Dear all,

We have an issue regarding reverse transaction in GL. When I do reverse one transaction in GL, there is a message appear "The date is not valid" so I cannot reverse it. I still can post the transaction as normal. Does any one know how to sovle this issue?

Thanks in advance.

hant

Comments

  • ara3n
    ara3n Member Posts: 9,258
    I've never seen the error. Turn on the debugger and see where it stops. Post the code in here and we might be able to help you.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • johnson_alonso
    johnson_alonso Member Posts: 690
    Dear hant,
    Ara3n is correct, you must use debugger and manual books first then if it can't be solved, post to this forum.
    G'Luck.


    Rgds,
    Johnson
  • kine
    kine Member Posts: 12,562
    It seems, like some date is not filled in correctly (is empty). As others suggested: use the debugger to see the source of the "invalid" date...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • hant
    hant Member Posts: 115
    Pls. see the debug as below:

    InsertGLEntry(CalcAddCurrResiduals)

    IF GLEntry."Posting Date" = NORMALDATE(GLEntry."Posting Date") THEN BEGIN
    BalanceCheckAmount :=
    BalanceCheckAmount + GLEntry.Amount * ((GLEntry."Posting Date" - 01010000D) MOD 99 + 1);
    BalanceCheckAmount2 :=
    BalanceCheckAmount2 + GLEntry.Amount * ((GLEntry."Posting Date" - 01010000D) MOD 98 + 1);
    END ELSE BEGIN
    BalanceCheckAmount :=
    BalanceCheckAmount + GLEntry.Amount * ((NORMALDATE(GLEntry."Posting Date") - 01010000D + 50) MOD 99 + 1);
    BalanceCheckAmount2 :=
    BalanceCheckAmount2 + GLEntry.Amount * ((NORMALDATE(GLEntry."Posting Date") - 01010000D + 50) MOD 98 + 1);
    END;

    .....

    Reverse(ReversalEntry,ReversalEntry2)

    InsertGLEntry(FALSE);

    ......

    Post(PrintRegister)

    GenJnlPostLine.Reverse(ReversalEntry,Rec);


    Pls. give me some advice.

    Thanks,

    hant
  • bobnavision
    bobnavision Member Posts: 159
    Navision gives Invalid date error on GL Entry when it finds a blank date.
    Please check are you supplying any blank date.
    The code does not give much information.

    Regards.
  • hant
    hant Member Posts: 115
    There are 2 date fields in G/L entry table and they are filled. I am not sure that is what you want me to check. Pls. advice.

    Thanks,

    hant
  • bobnavision
    bobnavision Member Posts: 159
    Take a date variable and assign the Value of Normaldate(Date)

    where date is Glentry date.
    put the code before execution of the code you printed above.

    Regards,
  • ara3n
    ara3n Member Posts: 9,258
    Also make sure in user setup you have a from and to posting date.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • hant
    hant Member Posts: 115
    We have not activated this functionality.
  • selece28
    selece28 Member Posts: 316
    I have the same problem, solved though
    This is what cause the error,
    When looping the reverse process, G/L Entry found 0 Date.
    That's because you have 1 Line in your G/L Account table contains 0 value,
    Look at top most of your G/L Entry table, delete the 0 line

    See what happen
    ______________

    Regards,
    Steven
  • hant
    hant Member Posts: 115
    Hi,

    I tried your solution but cannot fix the error. There's no entry no. 0 in G/L entry table. Do you have another suggestion?

    Regards,

    Hant
  • ara3n
    ara3n Member Posts: 9,258
    It could be that you have an invalid date in GL Entry.
    Click on File->database->information->Tables->Find table 17->click on Test.
    ->Check all the options->on Option tab, select File.

    Once the test is finished, open the file and take a look at it.
    See if there are anything about date.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n