Cannot Post Posting Date Not In Your Range

SavatageSavatage Member Posts: 7,142
edited 2014-01-20 in Navision Attain
Today we got the strangest error (for us) at least.

We got the Cannot Post due to not in the allowed range error.

Our Dates are 05/01/13 to 05/31/13. And the posting date is 05/01/13.

Debugging, I found in CU21 Item Jnl.-Check Line:
IF ("Posting Date" < AllowPostingFrom) OR ("Posting Date" > AllowPostingTo) THEN
    FIELDERROR("Posting Date",Text001);

Why would they make it < & > and not <= & >=????

I'm allowing a certain date why wouldn't "equal" be ok? So if any old version users get that message you know know the issue & fix

Anyway I changed the allowed posting date back to 4/30 and it allowed me to post for 5/1. #-o

Comments

  • DenSterDenSter Member Posts: 8,304
    You're supposed to get the error when the posting date is before the From Date, OR after the To Date, which is why there are no equal signs. That means that if the posting date is EQUAL to the From Date, you should NOT get an error message.

    What you are saying is that your posting date is 5/1, but even though the From Date equals that value, you are STILL getting the error?
  • ara3nara3n Member Posts: 9,255
    I think you need to look at the variables. they probably are different values. And the reason might be that adjust entry is is being made to another entry. That entry posting date is not within the range.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • SavatageSavatage Member Posts: 7,142
    edited 2013-05-02
  • SavatageSavatage Member Posts: 7,142
    I haven't checked the code on 2009 - 2013 but if I set my range from one date to another, II would assume it would accept it.
  • SavatageSavatage Member Posts: 7,142
    DenSter wrote:
    You're supposed to get the error when the posting date is before the From Date, OR after the To Date, which is why there are no equal signs. That means that if the posting date is EQUAL to the From Date, you should NOT get an error message.

    What you are saying is that your posting date is 5/1, but even though the From Date equals that value, you are STILL getting the error?

    yes - the debugger stops there.
    so it being equal caused the error (IMHO) since changing the date back 1 day allowed us to post..

    maybe it's a NAtive flaw :lol:
  • David_SingletonDavid_Singleton Member Posts: 5,479
    Savatage wrote:
    It's not a big deal but I thought it was odd that my allowable posting date range is 05/01/2013 to 05/31/2013 ( we change it every month to be strict on postings) But that code only allows it to post from 05/02/2013 to 05/31/2013. I'd figure it was fixed on newer versions.

    Daniel already covered this. The code is correct, you are just reading it wrong.

    IF NOT (A<B)
    is the same as
    IF (A>=B)
    David Singleton
  • SavatageSavatage Member Posts: 7,142
    You are correct. I was focusing on the wrong thing. That's what happens when you post after a bunch of beers at the Yankee game. :mrgreen:
  • AlbertvhAlbertvh Member Posts: 516
    Hi Savatage,
    Very late reply. :D
    Hope you sorted this one but just in case you haven't I had a similar problem.
    Check that the Posting Date is not a closing date i.e. C05/01/13
Sign In or Register to comment.