Simple VB.net WebService Example but not working

jwilderjwilder Member Posts: 263
edited 2009-03-02 in NAV Three Tier
I am trying to get a really simple web service running in vb.net. For some reason as soon as I start using the item table in my code (I tried this with Payment Terms table and I had no problem) I start getting the following error in Visual Studio (returned by the web service):
The Sales (Qty.) for Forecast field in the Item table must be active.

It is true that this field is not enabled but it has nothing to do with the code. Here is the code in my codeunit:
ItemNo = Code20 Parameter
ReturnValue is Text50

IF Item.GET(ItemNo) THEN
  EXIT(Item.Description);

Here is my VB.net code which I think is not the problem:
Dim MyService As New NAVWebservice.ItemCodeunit
Dim outputstring As String
MyService.UseDefaultCredentials = True
MyService.Url = "http://swk-lab2:7047/DynamicsNAV/WS/SWKTestU5/Codeunit/ItemCodeunit"
outputstring = MyService.ReturnDescription("101305")
MsgBox(outputstring)

Anyone run into something similar on a table that has a field that is not enabled?

Comments

  • jwilderjwilder Member Posts: 263
    By the way if I make that field active in table 27 it solves the problem. Does this mean we can only use web services with tables that have only active fields?
  • ara3nara3n Member Posts: 9,256
    I've tested the scenario and the table I was referencing in my function had disabled field and did not get any error.

    I could reproduce it if the field is a flowfield.

    So the assumption is no disabled flow field can be used in web services.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • jwilderjwilder Member Posts: 263
    That is good to know that it is flowfields only, which makes this problem not as big of a deal as I was initially thinking. I can deal with disabled flowfields, thanks!
  • ara3nara3n Member Posts: 9,256
    You're welcome.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
Sign In or Register to comment.