InstallationDeveloper Workstation Installation

Developer Workstation Installation

Import NAV Objects

Now the code base and the SQL database are in place and the NAV administration is configured to be accessed, the NAV side can be configured. 
 
To Install the Sana Commerce Objects in the NAV Administration the Following Steps Are Required:
  • Backup standard NAV objects;
  • Import new objects. These are new custom SC objects which most likely do not yet exist in the administration;
  • Update changed NAV objects. Some standard NAV objects are changed for SC that need to be updated;
  • Publish the 'SCL - NAV2009 WebService' codeunit as a web service using form 810 'Web Services' (NAV 2009 only);
  • Configure the Sana Commerce connection setup (any supported version of NAV in case of using WCF + NAS connection). The port number and protocol of the connection between the SC web applications and the NAV administration need to be configured in NAV.
Backup Standard NAV Objects:

The Sana Commerce installation includes the custom NAV objects as well as the standard objects modified for SC. In order to have the possibility to uninstall correctly the Sana Commerce solution in future, you must backup the objects changed for SC and keep this backup because it will be needed during the uninstallation of SC. It is required to do the backup of the SC objects before starting to import them.

Take the following steps in order to create the backup:
  • Open the 'Changed Objects Overview' chapter of the online help and locate the list of the standard NAV objects changed by SC;
  • Open the Object Designer in the NAV Client and select the objects which are listed in the aforementioned chapter. Export the selected objects to a 'fob' or 'txt' file;
  • Place the resulting 'fob' or 'txt' file to a reliable backup location and keep it for the whole period of using Sana Commerce.
Import New NAV Objects 
 
The objects for NAV 5.01 and 2009 SP1 Standard are stored directly in the Sana Commerce release package: the separate folder with them is available for each supported version of NAV (Classic environment). They can be found here: 'Sana Commerce (version no)\Navision'.
 
Each version folder contains subfolder(s) with supported localization(s) of NAV.
The following files are placed for import in each localization folder:
SCL_objects (.fob and .txt).  These files contain new Sana Commerce objects
and
SCL_Standard_objects (.fob and .txt). These files contain changed standard NAV objects.

For example, path to 'NL' localization objects is 'Sana Commerce (version no)\Navision\NAV2009SP1\NL' .

The objects for NAV 4.03 Standard are stored in the 'NAV 4.03 add-on' package that can be downloaded from the Sana Community web site: http://community.sana-software.com.
 
The objects for different versions of NAV with Pebblestone Fashion add-on are stored in the separate folders in the 'Pfs Fashion add-on' package.  The location of object for NAV 5.01 and 2009 SP1 is 'Pfs Fashion add-on' folder.
 
If you update the SC installation to a new version or the NAV objects from your current database have been customized, you should, in order to save your changes, manually update the new NAV objects from the SC project. To do this, you should export the changed NAV objects to a text file, then, using a merge tool, you merge this file with the 'SC_objects.txt' file and import the newly merged text file into NAV. 
 
Some input text fields used within the Sana Commerce webshop have a different maximum length in NAV v4 and v5. For now, NAV 5 field length validation is used in SC by default. Therefore, if you use NAV 5 there is no need to change input text field validation. But if you use NAV 4, changes to the validation for  
the select input text fields in order to prevent validation errors. Read the chapter 'Configure field lengths for NAV 4' in the 'Configuration' section for more details .
 
The process of importing the objects in NAV is the same for all versions. Please note though that in order to import objects in NAV 2009 you can use only the Classic NAV client.
  • Locate the 'Navision' directory in the SC installation directory. Please take into account that if you use NAV 5.0.1 you need to select files in the 'NAV501' folder, if you use NAV 2009 SP1, the files are in the 'NAV2009SP1' folder. If you use NAV with Pebblestone Fashion add-on, you should already have the 'Sana Commerce Fashion add-on' package (named 'Pfs Fashion add-on') with the separate files for different NAV versions which you should use instead of the files from the Standard version;
  • Open the NAV client, go to 'Tools' in the main menu and select 'Object Designer';
  • Go to 'File' and select 'Import'. Locate the file 'SCL_objects.fob' in the directory from 'Compile the Solution in Visual Studio' and press 'OK'. The following pop-up window appears: 

     
    Importing of New NAV Objects
     
  • Press 'Yes' to start the import of the new objects. An overview of the import is shown when it is finished.


    Importing of New Objects is Finished 
The Sana Commerce menus will only be shown after the import if the SC ID range is added to the NAV (developer) license used in the administration. 
 
Update Changed NAV Objects 
 
Updating of changed NAV objects can be done in two ways:
  • If the standard NAV objects in your database have already been customized, you should manually merge these objects with the objects from the SC package. Resulted objects will contain both your customization and SC changes:
    • Export the changed NAV objects to a text file using 'Object Designer';
    • Merge the text file with the 'SCL_Standard_objects.txt' file using a merge tool. Check the 'Microsoft Dynamics NAV Changes' section for an overview of the changes to the standard NAV objects;
    • Import the resulting text file in NAV;
    • Click 'All' in 'Object Designer';
    • Apply filter on the 'Compiled' column (click 'View > Field Filter' or press 'F7') and enter 'No' in the filter field;


    • Applying Filter on the 'Compiled' Column

    • Select all uncompiled objects and click 'Tools > Compile' (or press 'F11').


      Preparing to Compile the Objects

  • If standard objects in your NAV database are without any customization you can use the 'Import Worksheet' window:
    • Open 'Object Designer';
    • Go to 'File' and select 'Import'. Locate the file 'SCL_Standard_objects.fob' and press 'OK'
      You will get the following pop-up message:


      Conflicts Between Standard and Imported Objects were Found

    • Click 'OK' to open the 'Import Worksheet' window:


      'Import Worksheet' Window

    • A list of changed objects is shown. Make sure to select 'Replace' for changed objects in your administration to guarantee that the SC changes are correctly imported.


      Objects were Imported Successfully
Compilation of updated objects in case of updating using the 'fob' file is optional.

Publish the 'SCL - NAV2009 WebService' Codeunit as a Web Service Using Form 810 'Web Services' (NAV 2009 Only)
 
This step is required only when using SC with NAV 2009.
 
After the objects were imported or updated you should publish the 'SCL - NAV2009 WebService' codeunit as a web service using form 810 'Web Services':
  • Open the 'Object Designer';
  • Click the 'Codeunit' button;
  • Make sure that the codeunit 'SCL - NAV2009 WebService' (object ID: '11123303') is available;
  • Click the 'Form' button;
  • Locate the 'Web Services' form (object ID: '810') and click 'Run';
  • Create a new line with the following information:
    Object type - Codeunit
    Object ID - 11123303
    Service Name - SC_NAV2009_WebService
    Published - Yes (select the check-box)


    'Web Services' Form

  • Close the window and you are done.

Now you should check whether the new SC web service is published correctly. In order to do this:

The company name in the link (in our case it is 'CRONUS%20International%20Ltd') depends on the company name in a demo database you are going to use.
 

Indication That the Service is Published Correctly
 
Configure the SC Connection Setup 
 
In NAV the connection between the SC web applications and the NAV administration has to be configured. Since the SC is using a WCF service to communicate between the web applications and the NAV administration, two values have to be configured: the port number on which the WCF service is running and the protocol that is used to run the WCF service. 
 
When running the HTTPS protocol, make sure to request a SSL license file with a certification authority. In the development environment a test certificate can be used to test the HTTPS connection. More information about creating and installing SSL certificate can be found here. 
  • Open the NAV client, connect to the NAV administration and company, select 'Tools' in the top menu and select 'Object designer';
  • Click the 'Table' tab, locate and select the SC 'Options' table (ID = 11123305) and click the 'Run' button at the bottom;
  • Close the table and the 'Object Designer'.
InstallationDeveloper Workstation Installation