Error With Codeunit 21 - Item Jnl.-Check Line

jmlozaresjmlozares Member Posts: 110
Hi!

One of our client encounters problem regarding posting date during posting of Item Journal. I understand how the posting date validation work, so to say, this works in conjucntion with the GL Setup and the User Setup.

From the GL setup they provided restriction for the posting date. For example, they setup 070107..073107 for the from-to posting date fields respectively. While the user setup was left empty.

They got entries from the Item Journal with posting dates that fall within the range specified from the GL setup, therefore everything should be okay in terms of validating the posting date. But, something wrong is goin on during posting. The error that says "..is not within the range of the allowed posting date" keeps on poping. ](*,) though a valid posting date was provided.

I am stuck finding solution about this problem and tried just any workaround but nothing worked at all. Until I encounter this weird situation about the mentioned codeunit. From such codeunit I tried to put a messagebox that displays the document no., line no., and the posting date of the current journal line being processed:

...
IF ("Posting Date" < AllowPostingFrom) OR ("Posting Date" > AllowPostingTo) THEN BEGIN


MESSAGE("Document No." + '\' +
FORMAT("Line No.") + '\' +
FORMAT("Posting Date"));



FIELDERROR("Posting Date",Text001);
END;
...


I expect the messagebox to display the details of the journal lines that belongs to the Journal Batch that I was in, but surprisingly, the detail being shown by the messagebox was the detail of journal line from other Journal Batch. Isn't it weird? What could be wrong about this, knowing that this codeunit is the standard one? Could this be caused by SQL or SP3 or what?

BTW, they uses NAV SP3 Build No. 23305, and SQL Server 2005 running on top of Windows Server 2003.

Kindly provide any thought about my problem.[/b]
Janderol Lozares Jr.
Manila, Phils.

Comments

  • matttraxmatttrax Member Posts: 2,309
    Have you made any recent changes to Form 40 (Item Journal) or any of the item journal posting codeunits (21 - 23)?

    Try putting a message box at the top of the checkline codeunit to see if it is looping through every batch or just the one that it is not supposed to.

    There might be a SQL function in the background that is doing something it shouldn't. I've had one delete an order before Navision was done with it and no one could post. You never know.

    That's about all I can think of. Hope it helps.
  • jmlozaresjmlozares Member Posts: 110
    Hi Matttrax! Thanks for the reply.

    We did some updating with your mentioned objects. But I'm pretty sure it shouldn't affect the flow of the standard posting routine.

    I agree with your thought that SQL causes this abnormality with the process. As such, I'll be testing the SP2 version of SQL Server 2005 to be updated to the production environment, hoping this might solve this problem.

    Thank you very much and Best Regards! :)
    Janderol Lozares Jr.
    Manila, Phils.
  • kinekine Member Posts: 12,562
    1) Use SP3 if you are working on MS SQL 2005
    2) Have you Automatic cost adjustment enabled or disabled?
    3) Check the filters on the record passed as parameter into the posting codeunit. (through debugger or Message) There must be correct filters to post just selected batch and not all lines.
    4) When using message command, you can use this format:
     MESSAGE('%1\%2\%3',"Document No.","Line No.","Posting Date");
    
    Your code will be simplier and readable... (just a tip for you) 8)
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • jmlozaresjmlozares Member Posts: 110
    Hi Kine! Thanks for the reply!
    1) Use SP3 if you are working on MS SQL 2005
    2) Have you Automatic cost adjustment enabled or disabled?
    3) Check the filters on the record passed as parameter into the posting codeunit. (through debugger or Message) There must be correct filters to post just selected batch and not all lines.

    That's right, we're using SP3. Automatic cost adjustment is also enabled.

    I'll check the filtering as you advised. But I believe there shouldn't be an issue with regards to it since the standard codeunit wasn't modified in such a way that could possibly affect the standard posting process. BTW, I haven't mentioned that this problem is intermittent.

    One more thing, is it safe to roll out the SP2 release of SQL Server 2005?

    Thanks and Best Regards to all!
    Janderol Lozares Jr.
    Manila, Phils.
  • kinekine Member Posts: 12,562
    We are using SP2 for MS SQL 2005 without problems (and there is good performance and functional extension in Analysis services...).

    If you have automatic cost adjustment:
    1) It is performance killer - use it with big coution!
    2) It means that for each line you post the adjustment is running and it can adjust some entries with older date than allowed posting date. May be this is source of your problems. Try to disable it.
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • jmlozaresjmlozares Member Posts: 110
    Hi Kine!

    We'll going to disable the Automatic Cot Adjustment and rather manually execute the Adjust Cost - Item Entries on a periodic basis as required by the cost control dept.

    We'll monitor the effect of such update and hopefully this solves our problem with the posting date validation.

    You guys are such big help!! :D I'll give you feedback about the result.

    Thanks you sou much!!
    Janderol Lozares Jr.
    Manila, Phils.
Sign In or Register to comment.