Options

Publish NAV 2016 Extensions as webservice

fommo79fommo79 Member Posts: 2
Hi,

We have made an NAV 2016 Extension containing two codeunits (added, not modified standard CUs).
We have used such a setup earlier to create webservice functions to call from outside of NAV.
Do you know if it's possible to use Codeunits from an Extension as a published webservice? When we try to publish them, we get this error:
"The field Object ID of table Web Service contains a value (50002) that cannot be found in the related table (Object)"

However, when we use the dropdown we find the codeunit but get a warning saying that
"A RecordId from table 'AllObjWithCaption' cannot be used with a record from table 'Object'.

Does anybody know if this is a common restriction for NAV 2016 Extensions???

Best Answer

  • Options
    fommo79fommo79 Member Posts: 2
    Answer ✓
    I just found a solution, perhaps not beautiful but working.

    If you create a codeunit with the same object number in the object designer in the dev client it will make the extension CU to be visible to the web service publishing tool. Within NAV client it will only see the content of the created CU (in my case a Hello World), but when it is published and called from the outside it will actually call the functions of the installed Extension CU.
    Weird, but at least it's a way to do it and it works perfect. We can call all the functions of the CU without any problem.

Answers

  • Options
    fommo79fommo79 Member Posts: 2
    Answer ✓
    I just found a solution, perhaps not beautiful but working.

    If you create a codeunit with the same object number in the object designer in the dev client it will make the extension CU to be visible to the web service publishing tool. Within NAV client it will only see the content of the created CU (in my case a Hello World), but when it is published and called from the outside it will actually call the functions of the installed Extension CU.
    Weird, but at least it's a way to do it and it works perfect. We can call all the functions of the CU without any problem.
  • Options
    Peter+is1Peter+is1 Member Posts: 174
    Hi,

    There is an incompatibility with the Table Web Service, the field Object ID is related to table Object!
    When you disable that relation you can insert the extension codeunit as webservice.

    So I think 2016 is not completely ready yet for what you want.

    Have tested this in my 2016 cu4 and I even got a wdsl in my browser.
    Perhaps you can insert a record programmatically in the Web Service table to avoid the relation check?

    Good luck, fun stuff you are working on! :)
    \\
    The truth exists in seven versions.
Sign In or Register to comment.