Perfil de Santosh KumarSantosh Kumar Paruvella'...BlogListasLibro de visitasMás ![]() | Ayuda |
|
|
10 noviembre Using the Ax-Resource nodes as MetadataIn this example, I am storing XML file as Resource under AOT of Dynamics Ax. Also I am able to get back that resource as xml file, retrieving the file contents and use the same in our Business logic according to our needs. In the same way we can use Resources as Metadata. For a quick view of the new Resource node, see the following figure. Find the related jobs at the following path, this path contains two jobs for 1) Creation of new resource file. 2) Reading the same resource as file. For this article I got basic inputs from one of my previous colleague Santosh blog and also from MS employee Dilip (DaxDilip) blog. Thanks to both of you. 02 noviembre Different styles (*.css) for our EP pages of Ax 2009We can apply our custom styles for the newly developed pages or customized pages of EP. The following link gives in idea about, how to create our own custom css file and deploy the same in to web server. Hints on Workflow implementation for EP in Ax 2009When we are developing the workflow for EP in Dynamics Ax 2009, We won’t find the workflow related control on the Tool box list, as we are finding other controls like AxGridView etc. For this explicitly we need to add the Markup tags to the control. Select the AxUserControl, right click and select the View Markup Add the following lines in the markup view (change the properties accordingly as your scenarios) <%@ Register Assembly="Microsoft.Dynamics.Framework.Portal, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Namespace="Microsoft.Dynamics.Framework.Portal.UI.WebControls.Workflow" TagPrefix="dynamics" %>
<dynamics:AxWorkflowActionBar ID="WorkflowActionBar" runat="server" DataMember="ProjProposalJour_Current" DataSourceID="dsEPProjProposalInfo" onworkflowworkitemactioncompleted="WorkflowActionBar_WorkflowWorkItemActionCompleted" /> <dynamics:AxDataSource ID="dsEPProjProposalInfo" runat="server" DataSetName="EPProjProposalInfo" />
Observe form the above markup tags AxWorkflowActionBar and AxDataSource are connected using AxDatasource ID. (Properties mentioned in green color)
To implement the methods related to workflow control in the code behind sheet (in Actual C# code sheet), add the following line.
using Microsoft.Dynamics.Framework.Portal.UI.WebControls.Workflow;
For more details and how to implemnet the worklfow for EP pages, go through the following link.
07 octubre Target date not found in work calendar error of Workflow in Dynamics AxWell… My experience on this same thing, I want to share with my blog readers. While working on workflow in Dynamics Ax 2009, I had faced the following error. Error: Target date not found in work calendar error To resolve this error go through the document at the following location. 05 octubre Hide/Show the Dynamics Ax EP web partsIn some scenarios, in a single web page we need to Hide/Show the certain web parts based on the user profile. By using the following code snippets we can Hide the web parts of the page.
This example is for Hiding 1) AxToolbarWebPart 2) AxUserControlWebPart
Hidding the Toolbar
private void hideWebMenuToolBar() { WebPartManager webPartManager = WebPartManager.GetCurrentWebPartManager(this.Page) as WebPartManager; AxToolbarWebPart toolBarWebPart;
for (int i = 0; i < webPartManager.WebParts.Count; i++) { toolBarWebPart = webPartManager.WebParts[i] as AxToolbarWebPart;
if (toolBarWebPart != null && toolBarWebPart.WebMenuName == "TmCustomers") { toolBarWebPart.Hidden = true; break; }
} }
Hidding the User control webpart
private void hideWebPart() { WebPartManager webPartManager = WebPartManager.GetCurrentWebPartManager(this.Page) as WebPartManager; AxUserControlWebPart webPart;
for (int i = 0; i < webPartManager.WebParts.Count; i++) { webPart = webPartManager.WebParts[i] as AxUserControlWebPart;
if (webPart != null && webPart.ManagedContentItem == "TmMattersGrid") { webPart.Hidden = true; break; } } }
18 septiembre Dynamics Ax 2009 - EP - Framework.Portal.dll Error and Quick SolutionWhile working on EP (Browsing the pages) – encountered with the Unexpected ERROR. Error: An error occurred during the processing of . Could not load file or assembly 'Microsoft.Dynamics.Framework.Portal, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified. Some time back also found similar kind of error in Ax client also, while deploying the pages in to the AOT Error: Cannot add the specified assembly to the global assembly cache: Microsoft.Dynamics.Framework.Portal.dll Then I had checked in the Windows\Assembly path, and observed that Microsoft.Dynamics.Framework.Portal.dll is missed. Tried for copy and paste this .dll from Client\Bin folder to Windows\Assembly folder, it didn’t work. Solution: Did the drag and drop Microsoft.Dynamics.Framework.Portal.dll from Bin folder to assembly folder. After this drag and drop solution, EP is running without error. 11 septiembre Tree View Control in Dynamics Ax 2009 EPThis example is for displaying the Tree View control of ASP.Net by populating the customer details, in Dynamics Ax 2009 EP. For populating the data on the tree control, I had taken the help of Proxy methods concept in EP. I had implemented one method on the CustTable. public static CustTable getAllRecords() { CustTable custTable; Select * from custTable where custTable.CustGroup == "20"; return custTable; } The same method, I am calling in EP by using Proxy like as follows, IAxaptaRecordAdapter adapter = Microsoft.Dynamics.Portal.Application.Proxy.CustTable.getAllRecords(this.AxSession.AxaptaAdapter); We can get the IAxaptaRecordAdapter object in other ways also, in this application I am receiving the same by using Proxy method concept.
For code and design the application, find the document at the following location
02 septiembre Usage of (OR) condition in Ax Query's of Ax Client and EPIn this example, I want to display the records, from Project Table for the fields ProjId and ProjName have similar values like as show in figure.
Here I am filtering the records which have, ProjId and Project Name is 305492-00*
In simple I want to achieve this
Selec * from ProjTable where ProjTable.ProjId == “305492-001” || ProjTable.Name == “305492-001”;
Simple select query in Ax Client: static void projTableJob(Args _args) { ProjTable projTable; ;
while Select projTable where projTable.ProjId Like "305492-00*" || projTable.Name Like "305492-00*"
{ print projTable.Name; }
pause; }
Using Query Classes in Ax Client: The same query is implemented by using Query classes in Ax client
static void projTableJobUsingQuery(Args _args) { Query query; QueryBuildDataSource qb, qb1; QueryBuildRange qbr, qbr1; QueryRun qr; ProjTable projTable; str myvalue = '305492-00*'; ;
query = new Query(); qb = query.addDataSource(tablenum(ProjTable), "ProjTable");
qbr = qb.addRange(fieldnum(ProjTable, ProjId));
qbr.value(strfmt('(%1.%2 Like "%3") || (%1.%4 Like "%5")', qb.name(), fieldstr(ProjTable, ProjId), any2str(myvalue), fieldstr(ProjTable, Name), any2str(myvalue) ));
qr = new QueryRun(query);
while (qr.next()) { projTable = qr.get(tablenum(ProjTable)); print projtable.Name; }
pause;
}
The above query is implemented in Ax-2009 EP:
protected void Project_LookUp(object sender, AxLookupEventArgs e) {
AxLookup lookup = e.LookupControl; int projTableId = TableMetadata.TableNum(this.AxSession, "ProjTable");
//Create the lookup dataset - we will do a lookup in the Project table using (Proxy.SysDataSetBuilder sysDataSetBuilder = Proxy.SysDataSetBuilder.constructLookupDataSet(this.AxSession.AxaptaAdapter, TableMetadata.TableNum(this.AxSession, "ProjTable"))) {
// Set the run time generated data set as the lookup data set lookup.LookupDataSet = new DataSet(this.AxSession, sysDataSetBuilder.toDataSet()); } lookup.LookupDataSet.Init();
using (Proxy.Query query = lookup.LookupDataSet.DataSetViews[0].MasterDataSource.query()) { using (Proxy.QueryBuildDataSource dataSource = query.dataSourceName("ProjTable")) {
TableMetadata projTableMetadata = MetadataCache.GetTableMetadata(this.AxSession, projTableId);
TableDataFieldMetadata custAccountField = (TableDataFieldMetadata)projTableMetadata.Fields.GetByName("ProjId");
TableDataFieldMetadata nameField = (TableDataFieldMetadata)projTableMetadata.Fields.GetByName("Name");
String myValue = String.Format("((({0}.{1}) Like \"{3}\")) || (({0}.{2}) Like \"{3}\")))", projTableMetadata.ToString(), custAccountField.Name, nameField.Name, (string)SearchClient.Text.ToString());
using (Proxy.QueryBuildRange range = dataSource.addRange(custAccountField.FieldId)) { range.status = (int)Proxy.RangeStatus.Open; range.value = myValue; } } }
// Specify the lookup fields used
lookup.Fields.Add(AxBoundFieldFactory.Create(this.AxSession, lookup.LookupDataSetViewMetadata.ViewFields["ProjId"])); lookup.Fields.Add(AxBoundFieldFactory.Create(this.AxSession, lookup.LookupDataSetViewMetadata.ViewFields["Name"]));
// Specify the select field lookup.SelectField = "ProjId";
lookup.DefaultLookupGrid.ShowFilter = false;
}
Note: Here I am using Like Operator instead of ==. If we want to search the records by using wild characters (*,?), it’s suggested to use Like operator instead of ==, while working with Query classes.
Custom Lookups In Dynamics Ax 2009-EPIn this example, Customer Lookup is customized in EP using Query classes, as similar to Ax Client. This lookup is customized without using any Dataset. lookup is based on the Customer account number. To get a quick idea about this functionality, see the following figure. For code and design the application, find the document at the following location We can filter the data, simply using grid filters, but this article is mainly to focus on the customization of standard lookup’s according to certain condition. From this article, we can get an idea about how we can filter the standard lookups in EP ...24 agosto My experience with SL1 vs. BUSThis might be the known issue, but we suffered little bit, while working on SL1 and BUS features, and we resolved this issue after lots of research. I want share this experience with my blog readers. My Issue is: We are working for a client in BUS layer and my client suggested some features from SL1 and told us to do the customizations for SL1 features according to our functionality. So we installed SL1 on top of BUS layer, we are trying to work on that SL1 functionality, but we are not. We installed the same SL1 in standard version of Ax also (no BUS.aod’s in this one); in that environment we are able to use the SL1 functionality, but where as in SL1 + BUS dev environment we are not able to use the SL1 functionality. After lot of research we found that most of the standard Ax objects are modified by the SL1 and Bus layers, due to this, SL1 functionality is overridden by BUS layer, because BUS is upper layer and SL1 is lower layer. Then we had merged the SL1 functionality into BUS layer, after this we are able to use both the layers functionality. The main reason behind this issue is, we didn’t get the Upgrade Checklist after we installed the SL1 on top of the BUS layer, because we marked the check box option for the Prevent Startup of the checklist, after initialization check list is completed successfully, when we did the Ax installation. We didn’t see upgrade check list, so we thought, in SL1 they might have created all the new objects, like SYS layer objects, but after some research only we noticed that, they have done some customizations for Standard Ax (SYS layer) objects. Dynamics Ax-EP Testing multiple web parts of same pageTesting of multiple web parts in EP development… If we have a situation like, we want to host more than one web part in a single page, and we want to test that web parts before deploying into the SharePoint pages. [These web parts are like connected] Assume that we have three web parts and we want to test that three web parts before deploying on to the same page In our Development web parts - Visual studio solution, Move to the Design view of AxWebPartPage.aspx. We will find a control for testing a single web part. Now move to source view of the same page, we will find the following lines of code for that control. <dynamics:AxUserControlWebPart ID="AxUserControlWebPart1" runat="server" ManagedContentItem="CplTmConflictSearch" /> Copy that control source code and paste it two times as follows and change the ManagedContentItem property according to the name of the web part names. <dynamics:AxUserControlWebPart ID="AxUserControlWebPart2" runat="server" ManagedContentItem="CplTmConflictSearchGrid" />
<dynamics:AxUserControlWebPart ID="AxUserControlWebPart3" runat="server" ManagedContentItem="CplTmConflictSearchRelationGrid" />
Here I am testing that three web parts by using three controls of AxUserControlWebPart. Now run the solution, we can see the result in browser direclty; if it is success then we can deploy these web parts onto a single EP page. This way we can test multiple web parts of the same page. 10 julio Dynamics Ax EP Web Parts CommunicationDynamics 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; } }
}
Dynamics Ax EP Development - Simple StepsSimple 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.
04 junio Dynamics Ax in Outlook Part – IIIThis example is continuation of my previous blog entries of Dynamics Ax in Outlook Part – I and II. Ø In this example I am going to illustrate, how to displaying the Customer creation form with in Outlook. As in Outlook – Inbox is displayed.
Ø It’s not like a separate form, which I had shown in Dynamics Ax in Outlook Part – I blog entry. In that one, the Form is displayed as a separate object as per the standard options menu click events of Outlook.
Ø Here in this example the Customer creation form will be displayed as Inbox. i.e. within Outlook.
Development steps:
Ø Find the initial development steps which are there in this blog entry http://paruvella.spaces.live.com/blog/cns!F2EC589E221A4DB0!193.entry, till 5th steps are same for this application also. [Named the project as DynamicsAxCustomer – OutlookFolder]
Ø After completion of the first 5 steps Add Customer Service as a Service reference, to this project.
Ø Instead of .Net Windows Form, developed the User control, with similar appearance to the Form of the above blog entry.
Ø User control named as Customer.cs. Provide some GUID (e.g.74b7d27f-6cd3-4745-9ff5-ca5767c69723) for this user control.
Ø The Customer user control, registering as a Com Interop object with the registry. Using that GUID, the control will be registered in the registry.
Ø For registering this control, used an OutlookUtility.dll, this dll is developed by creating a new project called OutlookUtility. This OutlookUtility class library is developed by referring the Microsoft MSDN office integration articles. (Complete solution is attached with this article).
Ø That com object embedding in the html file and that same html file is attached to the newly created folder in MS –Outlook –Inbox, named as Customer Creation.
Ø The html file will be saved with GUID which mentioned in User Control (Customer.cs) Source code of the HTML File:
<html><body rightmargin = '0' leftmargin ='0' topmargin ='0' bottommargin = '0'> <object classid='clsid:74b7d27f-6cd3-4745-9ff5-ca5767c69723' ID='Customer' VIEWASTEXT width='100%' height='100%'/> </body></html> The newly created folder and user control which is embedded in html file can be viewed in Outlook the following figure. Ø Find the complete project for this example under the following link. Note: This same project can also use for previous articles, Dynamics Ax in Outlook. 01 junio Dynamics Ax –AIF –Web Services –Service end point error
Error: Could not find default endpoint element that references contract 'CustomerService.CustomerService' in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this contract could be found in the client element.
I had come across this error, while accessing the Dynamics Ax – AIF – Customer service from .Net windows user control. Work around, to solve the above error: Reference from #MSDN
using System.ServiceModel;
//Configures the security settings of a basicHttpBinding binding. System.ServiceModel.BasicHttpBinding binding = new System.ServiceModel.BasicHttpBinding(BasicHttpSecurityMode.TransportCredentialOnly); binding.Name = "BasicHttpBinding_CustomerService"; binding.HostNameComparisonMode = HostNameComparisonMode.StrongWildcard; binding.Security.Mode = BasicHttpSecurityMode.Message;
BasicHttpSecurity mySecurity = binding.Security; mySecurity.Transport.ClientCredentialType = HttpClientCredentialType.Windows; mySecurity.Mode = BasicHttpSecurityMode.TransportCredentialOnly; mySecurity.Message.ClientCredentialType = BasicHttpMessageCredentialType.UserName;
HttpTransportSecurity transSec = mySecurity.Transport;
EndpointAddress endpointAddress = new EndpointAddress("http://ban-srv-ax.digimakerbengaluru.com/MicrosoftDynamicsAXAif50/customerservice.svc");
//Calling the Ax Service by passing the Binding and endPoint Address object, becuase, while calling this //web service from user control we are not able to find the endpoint address of the service. //i.e. It's not able to read out the exact endpoint address from config file. CustomerServiceClient myCustomerService = new CustomerServiceClient(binding, endpointAddress);
EntityKey[] custAcc = myCustomerService.create(cust); MessageBox.Show("Created the customer and CustomerId is:" + custAcc[0].KeyData[0].Value, "Customer");
This is work around. In case we are able to access the CustomerService from IIS, but we are not able to create the proxy object for accessing the service in C# project. 21 mayo Dynamics Ax 2009 - Enterprise Portal Development Session by Microsoft TeamWow… Now we have a complete video session for the development of Enterprise Portal in Dynamics Ax 2009. Here we can find that link from channel9 Dynamics AX Enterprise Portal Development Webinar – Recording http://channel9.msdn.com/posts/diwakarb/Dynamics-AX-Enterprise-Portal-Development-Webinar/ Thanks to Microsoft EP Team. 14 mayo AxD Class Development – Security Key IssueAxD class Development – Security Key Issue: If we are developing the new AxD class and that AxD class we want to use through Web Services. Make sure that Service node of that corresponding AxD class has appropriate security key, otherwise the Services from that AxD class will not available for the end user. Dynamics Ax will throw the following error from this place Path: \Classes\AifRequestProcessor\verifyRequestIsAllowed -- Line no.7 Error: The user 'santo' does not have access to the service 'HNDWebLoginElementsService'. My space on Dynamics Ax Community.I am very happy to say all my blog readers, now my space is listed in Microsoft Dynamics Community site. Here we can find my space link in Microsoft Dynamics Community. https://community.dynamics.com/blogs/axsantoshkumar/default.aspx07 mayo Dynamics Ax - Business Connector IssuesIf we have multiple AOS’s, how the business connector works is, Business connector will log on to Microsoft Dynamics using the first available configuration from the registry and use it.
For example if we have AOS-I and AOS-II and in registry the active one is AOS-II.
But we want to work with AOS-I, like using AIF –Web Services and Enterprise Portal. How we can achieve this problem?
Solution is here:
Create the client configuration file for AOS-I and save it in local disk.
For AIF Web Services: Go to the IIS àWeb sites à Default websites àMicrosoft DynamicsAxAif50 Find the web.config file and open for edit and add following lines by finding <appSettings> the tag in that config file.
<appSettings> <add key="BUSINESS_CONNECTOR_CONFIGURATION" value="C:\Standard_BC_USR_2009.axc"/> </appSettings>
For EP: Go to the IIS and select the corresponding virtual folder for the share point portal and select the web.config file for edit and add the following lines to that web config file.
<Microsoft.Dynamics> <Session Timeout="15" Configuration="C:\Standard_BC_USR_2009.axc" /> </Microsoft.Dynamics>
In this way, we can work with selective AOS, even though we have multiple AOS’s. 05 mayo Dynamics Ax in Outlook Part - IIDisplaying Dynamics Ax – EP –Role center pages in Outlook This article is continuation of my previous article in this blog is Dynamics Ax in Outlook Part - I (Creation of Dynamics Ax - Customer from Outlook). http://paruvella.spaces.live.com/blog/cns!F2EC589E221A4DB0!193.entry . Now in this example I am giving the example C# code for displaying the Dynamics –Ax –EP –Role Center pages in MS –Outlook. See the following figure EP –Role center pages displayed in my mail box.
Add the following C# code in this class ThisAddIn.cs private void CreateCustomerFolder() { Outlook.NameSpace session = this.Application.Session;
Outlook.MAPIFolder cust = (Outlook.MAPIFolder)session.GetDefaultFolder(Microsoft.Office.Interop.Outlook.OlDefaultFolders.olFolderInbox).Parent;
Outlook.MAPIFolder custCreate = cust.Folders.Add("Customer", Microsoft.Office.Interop.Outlook.OlDefaultFolders.olFolderInbox);
custCreate.WebViewAllowNavigation = true; //This is our EP site custCreate.WebViewURL = "http://ban-srv-ax:86/sites/DynamicsAx"; custCreate.WebViewOn = true; }
And call this method from the following method private void ThisAddIn_Startup(object sender, System.EventArgs e) { RemoveMenubar(); AddMenuBar(); CreateCustomerFolder(); //See here I am calling that method here. } Compile the entire application and build. Run the application now you will see the new folder called Customer in the mail box hierarchy. Click on the customer now we can see the Role center page in outlook. What a great thing, I had done all these application by referring MSDN. My heart full and great full thanks to MSDN. |
|
|