General Journal Upload using .NET Business Connector

Sandeep_Prajapati
Member Posts: 151
Hi,
I am learning AX. The version is 4.0
I created a VB.NET app to pass General Journal line entries using .NET Business Connector.
The process consist of two parts :
1) Upload General Journal
2) Upload General Journal Lines.
first part i.e creating a general Journal (header/batch), using .NET Business Connector is working fine.
The problem is with 2nd part i.e. inserting lines.
The error I am getting is :
"Error executing code : NumberSeqFormHandlerLedgerJournal Object not initialized."
my VB.NET code :
Please help...
thanks in advance.
I am learning AX. The version is 4.0
I created a VB.NET app to pass General Journal line entries using .NET Business Connector.
The process consist of two parts :
1) Upload General Journal
2) Upload General Journal Lines.
first part i.e creating a general Journal (header/batch), using .NET Business Connector is working fine.
The problem is with 2nd part i.e. inserting lines.
The error I am getting is :
"Error executing code : NumberSeqFormHandlerLedgerJournal Object not initialized."
my VB.NET code :
Public Sub CreateJournal() Try Dim AX As New Axapta Dim JnlLine As AxaptaObject Dim numberSeqFormHandlerLedgerJournal As AxaptaObject Dim LedgerJournalTable As AxaptaObject Dim LoopRow As Integer Dim CompanyName As String AX.Logon("", "", "", "") AX.TTSBegin() DataGridView1.ReadOnly = True LedgerJournalTable = AX.CreateAxaptaObject("AxLedgerJournalTable") numberSeqFormHandlerLedgerJournal = AX.CreateAxaptaObject("numberSeqFormHandlerLedgerJournal") LedgerJournalTable.Call("parmJournalName", Me.TxtJournalName.Text.ToString()) LedgerJournalTable.Call("parmJournalNum", Me.TxtJournalNumber.Text.ToString()) LedgerJournalTable.Call("parmVoucherSeries", Me.TxtVoucherSeries.Text.ToString()) LedgerJournalTable.Call("save") // till here it works fine, i.e. ....able to insert in LedgerJournalTable. // Just to test, inserting just one line and hard coded values JnlLine = AX.CreateAxaptaObject("AXLedgerJournalTrans") JnlLine.Call("parmJournalNum", "San1") JnlLine.Call("parmLineNum", 1) JnlLine.Call("parmAccountType", 1) JnlLine.Call("parmAccountNum", "605500") JnlLine.Call("parmAmountCurDebit", 800) JnlLine.Call("parmCurrencyCode", "USD") JnlLine.Call("parmVoucher", "V_0001") JnlLine.Call("parmAmountCurCredit", 0) JnlLine.Call("parmOffsetAccount", 131100) JnlLine.Call("parmOffsetAccountType", 1) JnlLine.Call("parmTransDate", Today()) JnlLine.Call("parmCompany", "dmo") JnlLine.Call("parmOffsetCompany", "dmo") JnlLine.Call("Save") DataGridView1.Rows.Clear() AX.TTSCommit() AX.Logoff() MessageBox.Show(" Uploaded....!! ") Catch ex As Exception MsgBox(ex.Message) // here I get the exception msg triggered after "JnlLine.Call("Save")" Error executing code : NumberSeqFormHandlerLedgerJournal Object not initialized End Try End Sub
Please help...
thanks in advance.
Sandeep Prajapati
Technical Consultant, MS Dynamics NAV
Technical Consultant, MS Dynamics NAV
0
Comments
-
Hi Sandeep,
Please refer to this article - http://msdn.microsoft.com/en-us/library/aa478710.aspx. Note this line -
numberSeq = NumberSeq::newGetVoucherFromCode(ledgerJournalName.VoucherSeries);
Hope this helps,Harish Mohanbabu
Long way to go before I sleep..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