Thursday, June 11, 2009

Using ApplicationDefinitionDesigner to create ADF files

In recent article I have explained some free tools which will make SharePoint development faster

Now, I am going to explain one more tool called ApplicationDefinitionDesigner. This tool will help you to generate ADF file without breaking your head

Business Data Catalogue

Actually the Business Data Catalogue will help you to integrate business data from back end servers such as SAP, Oracle etc… to the SharePoint environment without writing single line of code, for successful implementation of this we need to have an ADF file

Now, I am going to explain how easily we can generate ADF file using this tool
Go to -> Start -> Programs -> ADF -> Click on Connect to Database
It will open a new window with Connection Type and Connection String

Choose type of connection then enter connection string in connectionstring text box
Then Click on Connect

Now, you can see new window with Add Table tab and Add View tab as shown in fig

Then expand Add table tab and drag and drop whatever table you want, here I drag and dropped product table because I like products

Then uncheck unwanted cloumns and click on ok button

Congrats, u have successfully created ADF file using ADF tool

Now, I am going to show you how to test that ADF file

Just right click on method instance name as shown in fig and click on Execute button, it will open new window then enter ProductID and click on Execute button

Finally the results data grid will populate with output

Now, I am going to step into little complex things that is creating filter using ADF tool here I am going to add new filter called color

Expand Entities - > Methods -> Click on method name and edit the sqlquery as shown in fig

Next, right on Filters link and click add filter, it will add new filter and go to the properties box and change the name to Color

Next, Go to parameters link and click on add parameter and then go to properties box and change Name to @Color and right click on @Color and select “Add Root level Element” and then go to properties box and change Name to Color and then the important step is change “FilterDescriptor “ to Color

Once Again you have successfully created ADF file

Next step testing that ADF file

Right click on method name and click on execute, it will open new window, enter ID and Color Values and click on Execute

Hey, What happened to my ADF file why it is not executing I followed all the steps correctly but why that error is coming???

The answer is i have done a mistake at parameters declaration as shown in fig

So now I am going to change that using notepad

Just export this ADF file to desktop and find that element and move it to top

The problem is that the return parameter should be a last parameter

Now execute method it will work properly

Then export this to central administration and use it in your site collection Business data list webpart

Happy Coding…