Codeunit Web Service error

amkdmkamkdmk Member Posts: 34
edited 2011-10-17 in NAV Three Tier
I'm working in a test environment where NAV 2009 is installed on one computer. For some reason my Codeunit Web Services now get an HTTP 500 error. Pages work fine. What's interesting is a week ago the Codeunits worked. The only thing that I know changed is there were some security patches installed on the server.

I've tried all the usual fixes including stopping/starting services, etc. There's nothing showing in the Event Viewer either.

Comments

  • amkdmkamkdmk Member Posts: 34
    I found that a new function was added to the Codeunit. In the code it calls a custom set up table. When I try to create a new Web Service with just this function I'm getting a "You must choose a company before you can use the XYZ table" error. I'm including the company name in the Web Service URL so I'm not sure what else to try.
  • kinekine Member Posts: 12,562
    May be the problem is in Codeunit 1, that there is some code using the table before company is selected...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • TFCrowtherTFCrowther Member Posts: 35
    I had the same error "You must choose a company before you can use the 'XYZ' table".

    The reason being I had a DELETEALL in the OnInitXMLPort() to clear a staging table.
    I moved the DELETEALL Code into the Codeunit rather than within the XMLPort to resolve the issue.
Sign In or Register to comment.