NAV 2009 webservices, create method and missing field values
Stefan_M
Member Posts: 6
Hi,
I'm fairly new to NAV 2009 and right now i'm having a problem.
Perhaps someone here has an idea how to solve it.
I exposed a NAV Page (Output Journal, ID 99000823) as a webservice.
Now i am trying to insert a line into the Output Journal via the create method of the webservice in a c# program.
Generally it works. A new line is created in the Output Journal and most of the fields are populated with the values I assigned in my program.
And here is my problem: There are some fields that are not updated at all, no matter what I do. Namely the fields for "Output_Quantity" and "Scrap_Quantity".
Their values remain 0, no matter what values I assigned in c#.
Here is a little bit of my c#-code to show what i am doing:
Any ideas? Am I missing a step or is it a bug?
I'm fairly new to NAV 2009 and right now i'm having a problem.
Perhaps someone here has an idea how to solve it.
I exposed a NAV Page (Output Journal, ID 99000823) as a webservice.
Now i am trying to insert a line into the Output Journal via the create method of the webservice in a c# program.
Generally it works. A new line is created in the Output Journal and most of the fields are populated with the values I assigned in my program.
And here is my problem: There are some fields that are not updated at all, no matter what I do. Namely the fields for "Output_Quantity" and "Scrap_Quantity".
Their values remain 0, no matter what values I assigned in c#.
Here is a little bit of my c#-code to show what i am doing:
Output_Journal_Service ojs = new Output_Journal_Service();
ojs.UseDefaultCredentials = true;
Output_Journal oj = new Output_Journal();
...
oj.Posting_Date = DateTime.Today;
...
oj.Output_Quantity = 42; // no matter what value is assigned, in the database/NAV client it is always 0
oj.Scrap_Quantity = 2; // here the same
...
ojs.Create("STANDARD", ref oj);
Any ideas? Am I missing a step or is it a bug?
0
Comments
-
I recommend the same way how you are inserting the line in C/AL:
1) Fill the Primary key fields (excluding line no.)
2) Insert the record into table
3) Fill rest of the fields
4) Modify the record0 -
Thanks kine, that did it.

My code looks now something like this:Output_Journal_Service ojs = new Output_Journal_Service(); ojs.UseDefaultCredentials = true; Output_Journal oj = new Output_Journal(); ... oj.Posting_Date = DateTime.Today; ... ojs.Create("STANDARD", ref oj); ... oj.Output_Quantity = 42; oj.Scrap_Quantity = 2; ... ojs.Update("STANDARD", ref oj);
It seems that some values can already be assigned before the create statement.
But others require to be assigned after the create and then require an update statement.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K 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
- 328 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
