Auto post item journal with spesific journal batch name

yonhantdaenta89@hotmail.com
Member Posts: 52
Hi Expert,
I am trying to do like "auto post" with specific journal Batch name. and I see that the code for posting in item journal like 3 lines below
CODEUNIT.RUN(CODEUNIT::"Item Jnl.-Post",Rec);
CurrentJnlBatchName := GETRANGEMAX("Journal Batch Name");
CurrPage.UPDATE(FALSE);
and when I test and debug it, it show error since that the "Journal Batch Name" = ''
and I need to push some value in that batch name. how to do so ?
thanks,
I am trying to do like "auto post" with specific journal Batch name. and I see that the code for posting in item journal like 3 lines below
CODEUNIT.RUN(CODEUNIT::"Item Jnl.-Post",Rec);
CurrentJnlBatchName := GETRANGEMAX("Journal Batch Name");
CurrPage.UPDATE(FALSE);
and when I test and debug it, it show error since that the "Journal Batch Name" = ''
and I need to push some value in that batch name. how to do so ?
thanks,
0
Answers
-
Journal pages are designed to run for a specific template. Withing the page you can choose a batch belonging to that template. The page sets filters for the selected template name and batch name.
For auto posting, you usually post journal line by journal line, not a whole batch, by just filling in the data needed, without inserting it into the table. In this case you leave template name and batch name fields blank.
You may however, fill in a batch and post the whole batch using the appropriate codeunit ("Item Jnl.-Post Batch" in this case). Either make sure the batch is empty before you fill it, or else filter the batch such, that only your inserted lines are visible within the filter when you post it.
If you need to post within a certain batch, follow the second path:- Insert into the batch,
- make sure only those lines you want to post are within the filter,
- call the batch post codeunit to post.
0
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