Perfil de Santosh KumarSantosh Kumar Paruvella'...BlogListasLibro de visitasMás ![]() | Ayuda |
|
|
20 noviembre Dynamics Ax Document Handling For The Mails Using Drag n DropIn my previous article, I had placed the example of Dynamics Ax Document handling for the files using Drag ‘N’ Drop option. In this article, we are going to see the example of Document handling for the mails (Outlook –Mail Items) using Drag ‘N’ Drop option. Steps: 1) Create a new form in Dynamics Ax and name it as MailDragnDrop_Paruvella. 2) Go to AOTàFormsà MailDragnDrop_ParuvellaàDesigns àDesign, right click and select the New control and from the control list select ActiveX control 3) Ax will open the list of ActiveX controls box (ActiveX Browser) and select the smmDrop2.smmDropWin class from available controls list
4) Add a new method for the ActiveX control as follows void onEvent_DropMail(COMVariant bMailIn, COMVariant strEntryID, COMVariant strStoreID) { DocuRef docuRef; ;
//Here I am passing CustAccountNum as 113443 i.e. I am attaching the mail item to this customer docuRef.RefRecId = CustTable::find("113443").RecId; docuRef.RefTableId = tablenum(CustTable);
if (MailDragnDrop_Paruvella::docuHandleDroppedEMail(docuRef, strEntryID.bStr(), strStoreID.bStr())) { info("Document attached successfully"); } else { info("not attached"); }
}
5) Now create a new class and name it as MailDragnDrop_Paruvella 6) Add a new method to the class as follows
public client static boolean docuHandleDroppedEMail(DocuRef _docuRef, smmEMailEntryID smmEMailEntryID = '', str smmEMailStoreID = '') { #define.outlookapplication('Outlook.Application') #define.mapidef('MAPI') #define.msgfile('msg')
NumberSeq numSeq; str tofilename; COM outlook; COM namespace; COM item; FilePath archivePath; DocuRef docuRef = _docuRef; int lines = infolog.line();
InteropPermission permission; DocuActionArchive docuActionArchive; str mailSubject, fileName, fileType; ;
permission = new InteropPermission(InteropKind::ComInterop); permission.assert();
// Initialize communication with Outlook outlook = new COM(#outlookapplication);
if (outlook) { // Get Outlook namespace namespace = outlook.getNamespace(#mapidef);
if (namespace) { // Get Outlook mail item item = namespace.getItemFromId(smmEMailEntryID, smmEMailStoreID); } }
// Check that the Outlook mail item was found if (!item) { return checkFailed("Outlook communication error. The mail item not found"); }
archivePath = Docu::archivePath(curExt());
if (! archivePath) { // The Windows path is used because the Outlook mail must be written somewhere on disk as a temp file before it can be saved in the database archivePath = WinAPI::getWindowsDirectory(); }
// Get a new number from the document numbersequence numSeq = NumberSeq::newGetNum(DocuParameters::numRefDocuNumber(), true);
// Use next number in numbersequence as filename fileName = smmDocuments::getNonExistingFileName(numSeq, archivePath, #msgfile);
// Save mail as the msg type file fileType = #msgfile;
// If path doesn't end with to backslash it should be appended archivePath = Docu::fileCheckPath(archivePath);
//docuValue.Path = archivePath;
// Create filename based on the path in the document type table and the filename (number) tofilename = archivePath + fileName + (fileType ? ('.' + fileType) : '');
// Save the e-mail as a .msg file try { // Call save function on the Outlook mail item item.saveAs(tofilename); mailSubject = item.subject(); } catch { // If the save function displays a COM error it should not be shown in the infolog infolog.clear(lines); }
// Check that the file was saved correctly if (!archivePath || !WinAPI::fileExists(tofilename)) { // Free the document numbersequence number that was reserved if the file wasn't found numSeq.abort();
return checkFailed("The file could not be saved"); } CodeAccessPermission::revertAssert();
ttsbegin;
// Mark the document numbersequence number is used numSeq.used();
// Create the document docuRef.Name = mailSubject; docuRef.TypeId = "Fil"; // this value is File here. docuRef.Notes = ""; docuRef.RefCompanyId = curExt(); docuRef.Restriction = DocuRestriction::Internal; docuRef.InterCompanySkipUpdate = InterCompanySkipUpdate::No; docuRef.smmTable = boolean::true; docuRef.ActualCompanyId = curExt(); docuRef.PartyId = "2"; docuRef.ContactPersonId = ""; docuRef.DEL_BusRelAccount = ""; docuRef.AuthorId = "100"; //curUserid -- employee Id docuRef.smmEMailEntryID = smmEMailEntryID; docuRef.smmEMailStoreID = smmEMailStoreID; docuRef.DEL_CampaignId = ""; docuRef.EncyclopediaItemId = ""; docuRef.insert(); ttscommit;
ttsbegin; docuRef.selectForUpdate(true); docuActionArchive = new DocuActionArchive(); docuActionArchive.add(docuRef, tofilename); ttscommit;
return true; }
7) Save and Compile the Class and Form. 8) Run the form and open the mail box (make sure that two windows are visible by resizing the mail box) 9) Select the mail from mailbox drag the mail and drop on to the ActiveX component of the form as show in below figure.
10) After this drag n drop option is completed, we will be prompted with following prompt
11) Just click on Allow button of the message box (it may appear 2-3 times click on Allow button always) 12) Then the selected mail will be attached to the customer record as a Outlook Message Item (*.msg). Find the complete project for this example at the following location.
12 noviembre Dynamics Ax Document Handling using File Drag n DropIn this example I am trying to achieve the Dynamics Ax Document Handling by using files Drag & drop option of windows OS. According to standard Ax, if we want to attach the documents to the customer records, We need to select the customer and select the Document Handling icon from the toolbar on the form as shown in below figure. Then it will open another form, on that form we need to click on New button, it will open the window's browser to select the file. In this example no need to do all the above steps, Ø Select the customer record fom Ax-Customers form, for which customer we want to attach the document. Ø Select the file to attach. Ø Drag the file and drop on the windows control as shown in below figure. Find the document at the following path, to understand how this example is implemented for the Customers.
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; } }
}
My blog has completed one year ...
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... By keeping this enthusiasm in sharing the information, I will update my blog with all my learning’s and my experience..... I would like to thank all the people who visited and read my blog...
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'. |
|
|