NAV 2009 R2 Webservice Create problem

mihail_kolev
Member Posts: 379
Hello there,
I'm facing a problem when creating records in Navision. I create a contact like this:
so far so good, but when I check the created contact, every integer field is left 0. Has anyone faced the problem (or am I doing it wrong :oops: )
I'm facing a problem when creating records in Navision. I create a contact like this:
Contacts Contact = new Contacts(); Contact.Name = String.Format("{0} {1}", FirstName, FamilyName); Contact.Address_Floor = 2; ContactsService.Create(ref Contact);
so far so good, but when I check the created contact, every integer field is left 0. Has anyone faced the problem (or am I doing it wrong :oops: )
-Mihail- [MCTS]
0
Answers
-
The integer fields in the Contact table are all flowfields. So you don't populate them in the Contact table itself - they are sums (or lookups, etc.) of fields from other tables.Alastair Farrugia0
-
No, these are my custom fields. I'm pretty sure they are not flowfields
. The interesting thing is that the Text, Option, Code fields are updated with the Create method. But integer fields can be updated only by the Update method. Not a big pain for me, but this forces me to make two web service calls instead of just one.
-Mihail- [MCTS]0 -
Hi mihail_kolev,mihail_kolev wrote:The interesting thing is that the Text, Option, Code fields are updated with the Create method. But integer fields can be updated only by the Update method. Not a big pain for me, but this forces me to make two web service calls instead of just one.
You need to put below code in your code.Contact.Address_FloorSpecified = true;
ExampleContacts Contact = new Contacts(); Contact.Name = String.Format("{0} {1}", FirstName, FamilyName); Contact.Address_FloorSpecified = true; Contact.Address_Floor = 2; ContactsService.Create(ref Contact);
Best Regards,
YukonMake Simple & Easy0 -
Didn't knew that, thank you very much =D>-Mihail- [MCTS]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