Monday, November 15, 2010

To find Dynamics SL build Version from database.

Past week I had a really an simple task a head, I have to find the Dynamics SL version from Database as I have written different logic in Sales order integration for each version.
I thought how hard could be that to get Current Version, I was wrong.

1. I tried to check setup Tables for column name "Version" in Dynamic SL System Database e.g. Custom, CustomVBA, Registration and few more. No success

2. Then tried to find column Name "Version" in SL Database, which also did not helped as there are few table in SL Application and System Database Column name as "Version" but no way related to Dynamics SL build Version.

3. In SL7.0, I found a glimpse of hope when I found a procedure "GetVersion" , which return Current build Version on System Database, Immediately realized that this Procedure have a select Statement with hard code build version. But the problem was, this Procedure does not exists in SL5.5, SL6.0 and SL6.5. I need a Solution which works for any Dynamics SL Version.

4. Solution :
Dynamics SL Current Version is maintained in Column "S4Future01" in Table : "GLSetup". Nice Place to hide.

Query:
"SELECT S4Future01 FROM GLSetup"

Hope this will be helpful, rather than trying trail and error methods I have been through.

Friday, November 12, 2010

Dynamics GP eConnect - How to blank out a field Through eConnect with existing data

One of the nicest thing on Dynamics GP eConnect turned out to be a big issue for me in one my implementation. Dynamics GP eConnect is very smart enough when NULL, blank, NOTMAPPED is passed thorugh XML schema to eConnect, it simply pick existing value or Default value from master setup. This saves lot of pain when we don't want to pass all the values in eConnect XML node.

I had a unique request from a client who wants the ability to blank out some of the fields e.g. Address details during Customer address migration through eConnect.
I tried out different options like passing Address Node as NULL, Blank and every thing went in vain.

Then practically left out with a option of writing a post procedure, where i need to check each field which is passed as blank, update it in SQL and need to be watch full with Default values set for the Field in SQL.

Then, CDATA Tag came for my rescue,

<ADDRESS3><![CDATA[ ]]></ADDRESS3>

Dynamics GP eConnect ability to blank out fields used to depend on what the default was for the field in the procedure (null or '')and only the null defaults could be cleared.
However, with passing a CDATA tag with a single space I was able to blank out fields regardless of the default in SQL.

Dynamic Navision Sales Order Integration - Sales Order header Already Exists

We had a requirement to integrate sales orders from third party system into Dynamics NAV 2009 SP1 using Sales Order page from web services in NAV2009. It worked Fine in our local Environment.

Trouble started when we deployed our App on Client Environment, it started throwing an error: "The Sales Header already exists. Identification fields and values: Document Type='Order',No.='2001'" though Order number does not exists in Dynamics NAV.

After Scratching our head for a while and thanks to Freddy, we found his blog and solution worked for us and saved a great deal of time.
http://blogs.msdn.com/b/freddyk/archive/2009/05/28/handling-sales-orders-from-page-based-web-services-in-nav-2009sp1-and-rtm.aspx

His solution was to mimic how Role Tailored Client Works to Insert a new order.
which is also MS recommendation on this issue.
1. Create the Order Header
2. Update the Order Header
3. Create an Order Line
4. Update an Order Line
(repeat steps 3-4)

you can find some sample code as well in his blog.