Perfil de Santosh KumarSantosh Kumar Paruvella'...BlogListasLibro de visitasMás Herramientas Ayuda

Blog


10 julio

Dynamics Ax EP Web Parts Communication

Dynamics Ax EP Web Parts Communication (Without using Share point connection)

We have a requirement for developing the two web parts for search criteria and both web parts have to be hosted on the same page.

According to my requirement, I have to place search fields in one web part and grid to be place in second web part.

Depends on the search operation, the grid has to show filtered records.

Web Part -I

Web Part - II

In web part – I,

1)      From the selection box we will select the Client ID or Client name.

2)      In search text box we will enter the value to be search.

3)      Image button to start/initiate the conflict search process. Search functionality will be implemented in button click event of the image button.

 

In web part – II,

1)      Grid will reflect with the filtered dataset.

2)      It will show the filtered records, based on the search.

These two web parts will be hosted in same page called ClientSearch.aspx.

After search operation is completed see the result of the page.

Find the following C# code for filtering the records in AxGrid based on the search criteria.

C# Code:

//This code is implemented in Web Part-I Image button click event.

protected void imgBtnSearchClient_Click(object sender, ImageClickEventArgs e)

{

       

        try

        {

            object[] parmList = new object[1];

           

            parmList[0] = tbSearchClient.Text;

 

            WebPartManager webPartManager = WebPartManager.GetCurrentWebPartManager(this.Page) as WebPartManager;

            AxUserControlWebPart webPart;                  

                      

 

            for (int i = 0; i < webPartManager.WebParts.Count; i++)

            {

               

               //Finding the second webpart in the web part zone

 

                webPart = webPartManager.WebParts[i] as AxUserControlWebPart;

                if (webPart != null && webPart.ManagedContentItem == "CplTmCustomerGrid")

                {

                   

                    //Finding the DataSource of second web part

                    AxDataSource dataSource = webPart.HostedControl.FindControl("DSClient") as AxDataSource;

                   

                   //Depends on search criteria refreshing the datasource of the second web part.

 

                    if (dataSource != null)

                    {

                        switch (ddlClient.SelectedValue)

                        {

                           

                            // filterCustomerId and filterCustomer are two filter methods implemeted on Ax-Dataset.

                            case "1":

                                dataSource.GetDataSet().DataSetRun.AxaptaObjectAdapter.Call("filterCustomerId", parmList);

                                break;

                            case "2":

                                dataSource.GetDataSet().DataSetRun.AxaptaObjectAdapter.Call("filterCustomer", parmList);

                                break;

 

                        }

 

                        dataSource.GetDataSet().DataSetViews[0].Research();                       

                    }                 

                  

                    break;

                }

            }                       

        }

        catch (System.Exception ex)

        {

            AxExceptionCategory exceptionCategory;

            // This returns true if the exception can be handled here

            if (!AxControlExceptionHandler.TryHandleException(this, ex, out exceptionCategory))

            {

                // The exception is system fatal - in this case we re-throw.                                   

                throw;

            }

        }            

 

}

Rainbow....Island with a palm tree...Umbrella.

 

 

My blog has completed one year ...

Red rose                                                               Red rose                                                                                           Red rose

I am very Happy to say all my blog readers, my blog has completed one year. I started my blog (July 10th, 2008).

I started my blog with the motivation from one of my colleague in my previous tenure.

He suggested me to; you are doing so much why you don’t share these things with others, you can share these things with others by writing your experience in to the blogs…..Which brought me into blogging in the first place. So far the journey has been really good... Auto

By keeping this enthusiasm in sharing the information, I will update my blog with all my learning’s and my experience..... Red heart

I would like to thank all the people who visited and read my blog... Smile

Red rose                                                               Red rose                                                                                            Red rose

Dynamics Ax EP Development - Simple Steps

Simple and easy steps in Dynamics Ax 2009 EP Development:

Here I want to give simple steps for EP Development in Dynamics Ax 2009.

1)      Create the EP web user control in VS.Net and deploy the same in to Dynamics Ax. (Already we have so many articles, How to develop web parts in VS.net For Dynamics Ax2009 EP and how to deploy them in to Ax)

 

2)      In Share point portal create an .aspx page for the above web control and add it to EP.

 

3)      Create a new web menu item for the above .aspx page in Dynamics Ax.

AOT à Web à Web Menu Items àURL right clicks and selects New URL.

 

4)      Set the properties of newly created URL àprovide that .aspx page path and give the required properties also.

 

5)      Now right click on that new URL and select Import option, and then Page Definition will be imported into the AOT.

AOT à Web à Web Files à Page Definitions under this we can observe our newly created Web Menu Items page.

 

6)      Save the web menu item.

 

7)      Create a new web menu and drag the above web menu item to this new web menu or drag the above web menu item to the existing web menu.

 

8)      Here 4, 5, 6 and 7 steps are called Quick launch i.e. creation of web menu items and web menus.

 

9)      Also these steps (4, 5 & 6) are called as Add Pages to navigation.

Gift with a bow         ...........      Auto