Thursday, 8 December 2016

Could not load file or assembly

I noticed after my upgrade to Microsoft Dynamics NAV 2015 version 8.00.40938  I get an error message on one of the boxes in my RoleCenter View 
"Control Add-in is missing could not load file or assembly Microsoft.Dynamics.Nav.Client.BusinessChart.Model".
I realized I was missing something then I tried this

This resolved my issue
I copied the BusinessChart Folder from my NAV Setup file into two paths on my C-drive
  •  C:\Program Files\Your_Path\Add-in\
  •  C:\Program Files (x86)\Your_Path\Add-in\
With this I was good to go. Happy me!!

Microsoft Dynamics NavClient stopped working


I read a lot of blogs to fix this issue but they all didn't work for me until I stumbled upon this, followed the one-time-step and it worked. This is the link to the step. Click here


How to Check the service running on your port.

I installed Microsoft Dynamics Nav 2015 on my machine and when I run it I get an error saying "Nav can't create a connection to the server". As usual I checked my event viewer to get a detailed message of the error. Then I found out another service -an earlier version of Microsoft Dynamics NAV (2013) was running on the same port as my Nav 2015. How did I know this?
  • Open command line
  • To check Service running on your port
    netstat -noa | find "port number" : It displays the PID
  • tasklist | find "PID"  : It displays the name of service running on your port which you can trace on Task Manger to disable it
Note: The PID is the last number after LISTENING
These simple steps saved my day as I was able to stop the process running on my port in Task Manager.



Tuesday, 6 December 2016

Microsoft Dynamics NAV Codeunit

Codeunit is a container for C/AL code that you can use across different application objects. -- just think of it as a class of functions.

Codeunit by default contains two functions: Documentation and OnRun
Documentation: where you write descriptive information about the codeunit
OnRun: It executes any code when you run the codeunit.

By using codeunit, you eliminate the need for duplicate code and make code easier to maintain. You can access the codeunit's function from another codeunit by declaring a datatype of codeunit in a variable and specifying the name of the codeunit in the subtype. Then you can do this 
<CodeunitVariableName>.<FuntionName>. To access a codeunit from other application objects, you must set the Local Property of the function to "No"


Microsoft Dynamics NAV Table

There are 3 types of a table in MS Dynamics NAV namely:

  1. Temporary Table
  2. System Table
  3. Virtual Table
Temporary Table: This is a temporary variable that holds a table. It is used as a buffer for table data.It is similar to a database table but differs in the sense that it is not stored in the database it is only held in memory until the table is closed.

System Table: This table is required for Microsoft dynamics NAV to work properly. Do not make changes to this table because the changes may not be valid for the future upgrade of NAV. System table is stored in the database and is automatically created.

Virtual Table: This table contains system information. You can not change the table data but read the information only. Unlike System Table, it is not stored in the database but computed by Microsoft Dynamics NAV at runtime.

SIFT: SumIndexField Technology.
It allows a user to quickly calculate decimal columns in a table. It is used to optimize the performance of Flowfields. A SumIndexField is always associated with a key. Microsoft Dynamics NAV uses Indexed View to maintain a SIFT key.

FlowField
It is a result of the calculation described in the CalcFormula Property. It is not a physical field that is stored in the database. There are 7 types of flowfield namely:  Sum, Average, Exist, Count, Min, Max, Lookup. A flowfield is always associated with a calculation formula.
How to Create a FlowField
  1. Open Object Designer and select a Table, click Design.
  2. Select a field you want for flowfield calculation.
  3. Click properties, select flowfield in dropdown menu for FieldClass property.
  4. Click the assist button for CalcFormula property to define your calculation for the flowfield

Thursday, 10 November 2016

SOLUTION

Solutions exist so that a set of customization can be purchased, shared or otherwise transported from one organization to another. It is a container for a set of components. 

Default Solution
When you customize the CRM system directly, you work with a special solution called the Default Solution. The Default Solution contains all the components in your system. Creating solutions is optional. You can customize your CRM system directly without ever creating a solution. You can only export your Default Solution as an unmanaged solution.

If a new solution is created, it references the components in the default solution and not copies of the components. So a custom or new solution is just a wrapper of the components of the default solution.


Managed Solution
A managed solution are used for distribution of solution. All the components of the solution are removed by uninstalling the solution. To create a managed solution, you choose the managed solution option when you export the solution. If you create a managed solution, you can’t import it back into the same organization you used to create it. You can only import it into a different organization

Unmanaged Solution
These are solutions used during development because they are customizable. When imported into an organization it over-writes the changes or custom development/customization of the latest solution in the organization. 

Versioning Solution
There are four numbers used separated by dots. e.g 1.2.3.4 
Sequentially, they are named (MMBR)

  • Major version number
  • Minor version number
  • Build number
  • Revision number
The first two numbers are updated when a new feature is added to the solution and the last two when a bug is fixed in the solution.

Customizing Solution after Exporting
It is possible to customize Managed solution after exporting the solution because by default Microsoft Dynamics CRM set "Can be Customized" property in the Managed Properties of every solution to true. If you want to restrict access to custom adjustments of the solution you have to set this property to false

Tuesday, 1 November 2016

Import Data from Excel into SQL Sever

So again today I faced another challenge as expected. The task for today was to import and merge data from four tables in a database located in a certain/specified server into a single table of an existing database on another server.
Connecting to the server wasn't the hard part, copying the data into an excel sheet and saving it as a CSV format wasn't either. It was importing of the data brought a headache. 
This is why I love Google. I get answers

These are the steps I followed to get the job done
Note: Create a Destination Table
  1. Convert the Excel format to  xlsx  because it's the only format accepted. 
  2. Connect to SQL Management studio, right-click the database , select "task" then "Import Data" 
  3. Select "Microsoft Excel" as the Source  and Choose the "File Location" then Follow the Wizard steps as shown on the screen.
  4. A table is created in the Database and it uses the Excel Title as the Table Name.
  5. Right-click on the Table, "Script Table as" ==>  "CREATE To" to get the CREATE Format of the table for your destination Table where all the data will eventually be. Copy and Run the script in your existing table to generate column names
  6. Right-Click on the Database, select "task" ==> "Generate Scripts" and Follow the Wizard to the Scripting Options page
  7. Select "Advanced" on the "Types of data to script" select any option that suits what you want to do
  8. Click on the file menu to add a file (the Generate script you just saved). once loaded edit the table name to point to the new Table (Destination table) and run the Query.
  9. Run Select (*) FROM Destination Table to confirm it has records.
  10. Repeat steps for all other Tables. 

An excel sheet can't take more than 1,048,576 rows.