Gen Jnl Post-Batch CU changes doc no, =>< symbol

wilk_u
Member Posts: 94
Hello,
I'm doing some posting through gen jnl lines and mentioned codeunit, which has function called Code() and that piece of code in it:
IF NOT FIND('=><') THEN BEGIN
"Line No." := 0;
COMMIT;
EXIT;
END;
after that in debugger my document no. in my genJnlLine changes, i.e. from TEST/12/00001 to TEST/11/00199 (previous year no series and its last number) what causes error later on in posting, nav says, doc no. should be TEST/12/00001.
I totally can't figure out what is happening.
Can anybody help?
Thanks in advance
I'm doing some posting through gen jnl lines and mentioned codeunit, which has function called Code() and that piece of code in it:
IF NOT FIND('=><') THEN BEGIN
"Line No." := 0;
COMMIT;
EXIT;
END;
after that in debugger my document no. in my genJnlLine changes, i.e. from TEST/12/00001 to TEST/11/00199 (previous year no series and its last number) what causes error later on in posting, nav says, doc no. should be TEST/12/00001.
I totally can't figure out what is happening.
Can anybody help?
Thanks in advance
0
Comments
-
Hi,
how did you filter the General Journal Line record before handing it of to Codeunit 13?
If your filters on the record point to another Journal line then the journal line you are handing to CU13, you will get an error.
For example:Journalline.GET('TemplateA', 'BatchA',10000); JournalLine.SETRANGE("Journal Batch Name",'BatchB'); Codeunit.RUN(13,JournalLine);
My advice is check your code just before you call codeunit 13. The problem probably exist in that area.
Hope this helps,
Regards,
WillyFostering a homeless, abused child is the hardest yet most rewarding thing I have ever done.0 -
wilk_u wrote:IF NOT FIND('=><') THEN BEGIN
This is a left over from the DOS days, and really is not needed now. It was used to optimize latency in hard drives. In SQL it has no performance difference.
Take a look at the code, and see if you can replace it with FINDFIRST, FINDSET or FIND('-'). There may be a NEXT that you also need to change.David Singleton0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions