how to pass a page webservice to NAV Codeunit

generic
Member Posts: 511
Hello.
Let say I publish a general journal page as a web service and then I have a codeunit that will take a general Journal as parameter and post it. I don't want to insert the record into the table.
I've tried to use CU as extension of a page, but when I try to use the function in C# the parameter is a string and not genjournal page object. Based on walkthrough, I was able to pass GenJournal.Key but I get an exception.
The exception is. The parameter GenJournalLine is null!
How do I pass the genjournal object to the the CU to be posted without inserting?
An example in C# would be helpful.
Thanks.
Let say I publish a general journal page as a web service and then I have a codeunit that will take a general Journal as parameter and post it. I don't want to insert the record into the table.
I've tried to use CU as extension of a page, but when I try to use the function in C# the parameter is a string and not genjournal page object. Based on walkthrough, I was able to pass GenJournal.Key but I get an exception.
The exception is. The parameter GenJournalLine is null!
How do I pass the genjournal object to the the CU to be posted without inserting?
An example in C# would be helpful.
Thanks.
0
Comments
-
Hello,
Since you have not read the record of General Journal Line which you want to post, record to pass as a parameter is not initialized. So, you are getting Exception like GeneralJournalLine is null.
For your requirement of posting the General Journal, first you will need to READ the record of General Journal Line, which you want to Post.
After reading the Record, you will get one Reference of the General Journal Line Record.
Then, on calling the function of Codeunit to Post, pass this Reference of General Journal Line record as a parameter.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