Help! Technical Upgrade NAV 4 SP3 for Web Services

bstapyltonbstapylton Member Posts: 34
edited 2009-11-26 in NAV Three Tier
Hi guys,

I have read through quite a number of discussions on the issue and followed this guide:
https://community.dynamics.com/blogs/na ... -2009.aspx


My goal is to do an exe upgrade from a 403 database to a 2009SP1 install for the sole purpose of using Codeunits and Pages for Web Services. Here is what I've been up to:

For testing purposes I started with a Cronus 403 database.

I imported the Web Service form and all Pages from a Cronus 2009 SP1 database.


Used the Transformation tool and followed this MSDN walkthrough (http://msdn.microsoft.com/en-us/library/dd338789.aspx) to transform some forms (including Sales Order, Customer Card, Contact Card) into pages. The pages had some issues when compiling with NAV not liking some links in LookupFormID fields and the like. For the purpose of my testing I just removed the links to allow the Pages to compile.

Once I had the objects compiling I could expose the Contact page as a Web Service and connect to the API using Web References in VS.



I coded a small program to create a new Contact. VS compiles and everything was looking good until I received this error thrown from the Create() function:


Note: this error message looks much better in Notepad with Word Wrap turned off.
Compilation of assembly 'C:\ProgramData\Microsoft\Microsoft Dynamics NAV\60\Server\MicrosoftDynamicsNavServer\assembly\Codeunit5072.dll' failed. This can be caused by differences between binaries in your installation or your database. Ensure that all installation components are consistent and up to date. Error details: c:\ProgramData\Microsoft\Microsoft Dynamics NAV\60\Server\MicrosoftDynamicsNavServer\source\Codeunit\Codeunit5072.cs(2186,27) : error CS0117: 'object' does not contain a definition for 'IsClear'
c:\ProgramData\Microsoft\Microsoft Dynamics NAV\60\Server\MicrosoftDynamicsNavServer\source\Codeunit\Codeunit5072.cs(2193,9) : error CS1502: The best overloaded method match for 'Microsoft.Dynamics.Nav.Runtime.NavAutomation.ALAssign(Microsoft.Dynamics.Nav.Runtime.NavAutomation)' has some invalid arguments
c:\ProgramData\Microsoft\Microsoft Dynamics NAV\60\Server\MicrosoftDynamicsNavServer\source\Codeunit\Codeunit5072.cs(2193,28) : error CS1503: Argument '1': cannot convert from 'object' to 'Microsoft.Dynamics.Nav.Runtime.NavAutomation'
c:\ProgramData\Microsoft\Microsoft Dynamics NAV\60\Server\MicrosoftDynamicsNavServer\source\Codeunit\Codeunit5072.cs(2255,11) : error CS1502: The best overloaded method match for 'Microsoft.Dynamics.Nav.Runtime.NavAutomation.ALAssign(Microsoft.Dynamics.Nav.Runtime.NavAutomation)' has some invalid arguments
c:\ProgramData\Microsoft\Microsoft Dynamics NAV\60\Server\MicrosoftDynamicsNavServer\source\Codeunit\Codeunit5072.cs(2255,30) : error CS1503: Argument '1': cannot convert from 'object' to 'Microsoft.Dynamics.Nav.Runtime.NavAutomation'
c:\ProgramData\Microsoft\Microsoft Dynamics NAV\60\Server\MicrosoftDynamicsNavServer\source\Codeunit\Codeunit5072.cs(2350,31) : error CS0117: 'object' does not contain a definition for 'IsClear'
c:\ProgramData\Microsoft\Microsoft Dynamics NAV\60\Server\MicrosoftDynamicsNavServer\source\Codeunit\Codeunit5072.cs(2357,9) : error CS1502: The best overloaded method match for 'Microsoft.Dynamics.Nav.Runtime.NavAutomation.ALAssign(Microsoft.Dynamics.Nav.Runtime.NavAutomation)' has some invalid arguments
c:\ProgramData\Microsoft\Microsoft Dynamics NAV\60\Server\MicrosoftDynamicsNavServer\source\Codeunit\Codeunit5072.cs(2357,32) : error CS1503: Argument '1': cannot convert from 'object' to 'Microsoft.Dynamics.Nav.Runtime.NavAutomation'
c:\ProgramData\Microsoft\Microsoft Dynamics NAV\60\Server\MicrosoftDynamicsNavServer\source\Codeunit\Codeunit5072.cs(2388,31) : error CS0117: 'object' does not contain a definition for 'IsClear'
c:\ProgramData\Microsoft\Microsoft Dynamics NAV\60\Server\MicrosoftDynamicsNavServer\source\Codeunit\Codeunit5072.cs(2395,9) : error CS1502: The best overloaded method match for 'Microsoft.Dynamics.Nav.Runtime.NavAutomation.ALAssign(Microsoft.Dynamics.Nav.Runtime.NavAutomation)' has some invalid arguments
c:\ProgramData\Microsoft\Microsoft Dynamics NAV\60\Server\MicrosoftDynamicsNavServer\source\Codeunit\Codeunit5072.cs(2395,32) : error CS1503: Argument '1': cannot convert from 'object' to 'Microsoft.Dynamics.Nav.Runtime.NavAutomation'
c:\ProgramData\Microsoft\Microsoft Dynamics NAV\60\Server\MicrosoftDynamicsNavServer\source\Codeunit\Codeunit5072.cs(2494,24) : error CS0117: 'object' does not contain a definition for 'IsClear'
c:\ProgramData\Microsoft\Microsoft Dynamics NAV\60\Server\MicrosoftDynamicsNavServer\source\Codeunit\Codeunit5072.cs(2501,9) : error CS1502: The best overloaded method match for 'Microsoft.Dynamics.Nav.Runtime.NavAutomation.ALAssign(Microsoft.Dynamics.Nav.Runtime.NavAutomation)' has some invalid arguments
c:\ProgramData\Microsoft\Microsoft Dynamics NAV\60\Server\MicrosoftDynamicsNavServer\source\Codeunit\Codeunit5072.cs(2501,25) : error CS1503: Argument '1': cannot convert from 'object' to 'Microsoft.Dynamics.Nav.Runtime.NavAutomation'
c:\ProgramData\Microsoft\Microsoft Dynamics NAV\60\Server\MicrosoftDynamicsNavServer\source\Codeunit\Codeunit5072.cs(2532,24) : error CS0117: 'object' does not contain a definition for 'IsClear'
c:\ProgramData\Microsoft\Microsoft Dynamics NAV\60\Server\MicrosoftDynamicsNavServer\source\Codeunit\Codeunit5072.cs(2539,9) : error CS1502: The best overloaded method match for 'Microsoft.Dynamics.Nav.Runtime.NavAutomation.ALAssign(Microsoft.Dynamics.Nav.Runtime.NavAutomation)' has some invalid arguments
c:\ProgramData\Microsoft\Microsoft Dynamics NAV\60\Server\MicrosoftDynamicsNavServer\source\Codeunit\Codeunit5072.cs(2539,25) : error CS1503: Argument '1': cannot convert from 'object' to 'Microsoft.Dynamics.Nav.Runtime.NavAutomation'


I compiled the CodeUnit 5072, compiled my Tables, Pages and Forms that would compile (some would not but were all to do with EMail and looked unrelated to the Contact Card - "Could not load the selected type library.").


I have cleared the rows in the Object Tracker table and stopped/started the NAV Service but alas the error continues to be thrown. There are no files in the c:\ProgramData\Microsoft\Microsoft Dynamics NAV\60\Server\MicrosoftDynamicsNavServer\assembly folder but the Codeunit5072.cs file is in the source folder.


Are there any other steps needed to successfully consume an exposed Page in this scenario?

Comments

  • ara3nara3n Member Posts: 9,256
    Have you checked in File->database->alter "enable for MS Nav Server " in option tab?
    we have 4.0 db with 2009 exe with webservices
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • bstapyltonbstapylton Member Posts: 34
    Hi Ara3n.

    Yes I have enabled that. Was going to include it in my description but it would open the floodgates to all the other little bits and pieces I've done along the way - and the last thing I want is for you all to read a wall of text :)


    Is your 4.0 db with 2009 exe including the Page objects from 2009SP1? Or did you do a Transformation to utilise the pages?
  • ara3nara3n Member Posts: 9,256
    we built the pages manually. you can use the wizard that was introduced in 2009 sp1.
    We can also run the pages and see them in RTC.
    We had to create a blank Role Center page and copy the 10K rane menuesuites from 2009 into 4.0 db.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • bstapyltonbstapylton Member Posts: 34
    Thanks Rashed - I might decide to try making my own Pages. They only really need the functionality to be called as Web Services - no RTC will be used... hopefully it's straight-forward!


    Still a bit confused on why I'm getting the error in my original post, though. From what I've read the WebServices should be working the way they are.
  • ara3nara3n Member Posts: 9,256
    you don't need to make all the pages. We only have 10 pages that are needed for webservice, you don't need to transfer all the forms.

    It looks like CU 5072 is outlook Application Management that synchronizes contacts.

    You'll need to change your code to not call it when called through webservice.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • bstapyltonbstapylton Member Posts: 34
    Thanks again, Rashed.

    I temporarily commented out the code relating to the CU from the Contact table and the Web Service request is working as intended now!


    Regarding "changing the code" to work differently when called from a Web Service:

    I have been looking for a function that will identify the caller object, so I can test - but have been unfruitful so far.


    Do you recommend a method to get this done?

    Thanks and best regards!
  • ara3nara3n Member Posts: 9,256
    You can use

    IF ISSERVICETIER THEN BEGIN

    END;
    Ahmed Rashed Amini
    Independent Consultant/Developer


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