How to Skip Confirmation Message for Posting in Item Journal?

julkifli33
Member Posts: 1,092
hi All,
I have created new module.
after insert Item Journal Line, i want to immediately post it.
how do i skip this confirmation message?

my code :
I have created new module.
after insert Item Journal Line, i want to immediately post it.
how do i skip this confirmation message?

my code :
ItemJournalLine.Insert; CODEUNIT.RUN(CODEUNIT::"Item Jnl.-Post", ItemJournalLine);
0
Answers
-
Post directly thru codeunit 22 "Item Jnl.-Post Line". But be careful you don't require any functionality handled by the related precalled codeunits. Such as related warehouse journal handling
There are no bugs - only undocumented features.0 -
Can`t you subscribe to OnBeforeCode(ItemJnlLine, HideDialog, SuppressCommit, IsHandled); in codeunit "Item Jnl.-Post" and set HideDialog to true?0
-
The piece of code seems to be located in CU231 Text001.
I dont know how you can skip it in business central without changing base app code, there is no hidedialog for this function in my nav version at least.
In classic nav is quite simple but not in BC.
0 -
This is how it looks like in BC18 (OnBeforeCode is available with HideDialog):
codeunit 241 "Item Jnl.-Post" { TableNo = "Item Journal Line"; trigger OnRun() begin ItemJnlLine.Copy(Rec); Code; Copy(ItemJnlLine); end; var Text000: Label 'cannot be filtered when posting recurring journals'; Text001: Label 'Do you want to post the journal lines?'; Text002: Label 'There is nothing to post.'; Text003: Label 'The journal lines were successfully posted.'; Text004: Label 'The journal lines were successfully posted. '; Text005: Label 'You are now in the %1 journal.'; ItemJnlTemplate: Record "Item Journal Template"; ItemJnlLine: Record "Item Journal Line"; TempJnlBatchName: Code[10]; local procedure "Code"() var ItemJnlPostBatch: Codeunit "Item Jnl.-Post Batch"; HideDialog: Boolean; SuppressCommit: Boolean; IsHandled: Boolean; begin HideDialog := false; SuppressCommit := false; IsHandled := false; OnBeforeCode(ItemJnlLine, HideDialog, SuppressCommit, IsHandled); if IsHandled then exit; with ItemJnlLine do begin
0 -
ok thanks for all the suggestion.
by the way i am using cloud bc, so its not possible to change the standard code.
i will try to use OnBeforeCode
Thanks.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