Setting option fields when creating a new customer record

khanhlkhanhl Member Posts: 3
Hi

Any idea on why the Blocked option field is not set when the following customer is created in navision?

Customer_Service custService = new Customer_Service();
custService.Credentials = NavisionUserCredentials;
Customer customer = new Customer() { No = "TEST 1", Name = "Test 1", Contact = "testuser", Blocked = Blocked.Ship};
custService.Create(ref customer);

Thanks
KL

Comments

  • kinekine Member Posts: 12,562
    Try to create it first just by setting the No and then modify it with the rest. There could be code in the OnInsert in NAV which will clear the field. Just a guess...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • veerendraveerendra Member Posts: 66
    Use the following and it will work... \:D/

    Customer customer = new Customer() { No = "TEST 1", Name = "Test 1", Contact = "testuser", Blocked = Blocked.Ship, BlockedSpecified = true};
    Veerendra Ch.
    http://midynav.blogspot.com/ (Microsoft Dynamics Navision)
Sign In or Register to comment.