RSS

Category Archives: Microsoft Dynamics AX

Port conflict with existing application- D365 Data entity Import/Export Error Unable to start Azure Table Storage

As I posted in previous post, I was getting issue of Azure table storage services while D365 import/ export data through data entity.

Whenever I was facing the above issue then i used to run the BAT file command in previous post  D365 Data entity Import/Export Error Unable to connect to the remote server’ Error with Azure Table Storage.

 

Suddenly i started getting an error of Port conflict with existing application while starting the services of Azure table storage.

Microsoft Azure Tools: Failed to initialize Microsoft Azure storage emulator. Port conflict with existing application.

By default, Azure storage emulator is using port number 100001000110002 for Blob, Queue and Table services respectively.

If you have existing applications using these port numbers and can’t be changed, you can resolve the port conflict by changing Azure storage emulator default port numbers to avoid port conflict as the steps below:

  1. Stop your Azure storage emulator service
  2. Go to your storage emulator default installation folder, which is located at C:\Program Files (x86)\Microsoft SDKs\Azure\Storage Emulator
  3. Open the AzureStorageEmulator.exe.config file for edit
  4. Edit the default port numbers as shown below enter image description here
  5. Start your Azure storage emulator service.

You should expect the Azure storage emulator to start successfully without any port conflict.

Happy Daxing. 🙂

Advertisements
 

D365 Data entity Import/Export Error Unable to connect to the remote server’ Error with Azure Table Storage

I was trying to export the data from standard/Custom data entity on my local for D365O and started getting error “No export file found for entity”

When i click on export its shows me executed successfully but when i click on download file it throw me below error

Microsoft.WindowsAzure.Storage.StorageException: Unable to connect to the remote server —> System.Net.WebException: Unable to connect to the remote server —> Sys
tem.Net.Sockets.SocketException: 
Unable to connect to the remote server ---> System.Net.Sockets.SocketException:
No connection could be made because the target machine actively refused it 127.0.0.1:10002
at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception)
   --- End of inner exception stack trace ---
   at System.Net.HttpWebRequest.GetResponse()
at Microsoft.WindowsAzure.Storage.Core.Executor.Executor.ExecuteSync[T](RESTCommand`1 cmd, IRetryPolicy policy, OperationContext operationContext)
   --- End of inner exception stack trace ---
   at Microsoft.WindowsAzure.Storage.Core.Executor.Executor.ExecuteSync[T](RESTCommand`1 cmd, IRetryPolicy policy, OperationContext operationContext)
   at Microsoft.WindowsAzure.Storage.Table.CloudTable.Exists(Boolean primaryOnly, TableRequestOptions requestOptions, OperationContext operationContext)
   at Microsoft.WindowsAzure.Storage.Table.CloudTable.CreateIfNotExists(TableRequestOptions requestOptions, OperationContext operationContext)
   at Microsoft.DynamicsOnline.Infrastructure.Components.TableAccessor.TableStorageAccessor.PerformOperation(CloudStorageAccount storageAccount, String tableName, Func`1 operation)
   at Microsoft.DynamicsOnline.Infrastructure.Components.TableAccessor.TableStorageAccessor.AddRecord[T](CloudStorageAccount storageAccount, String tableName, T record)
   at Microsoft.DynamicsOnline.Infrastructure.Components.SharedServiceUnitStorage.SharedServiceUnitStorage.CreateData(SharedServiceUnitStorageData data, Boolean setDirectPathWhenAvailable)
   at Dynamics.AX.Application.DmfDataPopulation.`getBlobWriteUrlInCategory(Guid _fileId, String _fileName, Boolean getDirectBlobLinkWhenAvailable, String category) in xppSource://Source/ApplicationFoundation\AxClass_DmfDataPopulation.xpp:line 153
   at Dynamics.AX.Application.DmfDataPopulation.getBlobWriteUrlInCategory(Guid _fileId, String _fileName, Boolean getDirectBlobLinkWhenAvailable, String category)
   at Dynamics.AX.Application.DmfDataPopulation.`getAzureBlobWriteUrl(Guid _fileId, String _fileName, String category, Boolean @category_IsDefaultSet) in xppSource://Source/ApplicationFoundation\AxClass_DmfDataPopulation.xpp:line 111
   at Dynamics.AX.Application.DmfDataPopulation.getAzureBlobWriteUrl(Guid _fileId, String _fileName, String category, Boolean @category_IsDefaultSet)
   at Dynamics.AX.Application.DmfDataPopulation.getAzureBlobWriteUrl(Guid _fileId, String _fileName)

 at Dynamics.AX.Application.DMFGenerateSSISPackage.`generateFileDataV2(DMFDefinitionGroupExecution _dmfDefinitionGroupExecution, String _defGroupName, DMFFileFormat _fileFormat, DMFDelimiter _rowDelimiter, DMFDelimiter _columnDelimiter, String _codePage, String _locale, NoYes _isFirstRowHeader, NoYes _unicode, String _source, String _textQualifier, DMFXMLStyle _style, String _rootElement, String _filePath, Map _entitySyncVersion, Int32 _previewCount, Boolean @_entitySyncVersion_IsDefaultSet, Boolean @_previewCount_IsDefaultSet) in xppSource://Source/ApplicationFoundation\AxClass_DMFGenerateSSISPackage.xpp:line 1073
Request Information
RequestID:
RequestDate:
StatusMessage:

This is because of cache of azure blob storage or azure store emulator stopped working.

This will appear when you try to export/ import the data from D365 or with recurring scheduled import/export job as well.

 

You can create an BAT File and run as administrator on your D365 VM machine.

SET emu="%programfiles(x86)%\Microsoft SDKs\Azure\Storage Emulator\AzureStorageEmulator.exe"
%emu% stop
%emu% clear all
%emu% start

This will clear out the blob storage and restart the emulator.

 

Reference Articles:

https://sites.google.com/site/dynamicsaxblog/how-to-list-ax7/howtodataentitiesexport-unabletoconnecttotheremoteserver

https://community.dynamics.com/365/financeandoperations/f/765/t/279670

http://geekswithblogs.net/paulschapman/archive/2009/01/02/unable-to-connect-to-the-remote-server-error-with-azure.aspx

 

 

Tags: , , ,

To Debug Ax Service Operations Framework

To debug the Dynamics Ax, service operations (SysOperationService) framework, change the following method as follows…

Classes –> SysOperationRPCFrameworkService –>runServiceOperation

 

/*return SysDictClass::invokeStaticMethodIL(classStr(SysOperationServiceController),

                                        staticMethodStr(SysOperationServiceController, runServiceOperation),

                                        [controllerClassId, packedController]);*/

return SysOperationServiceController::runServiceOperation([controllerClassId, packedController]);

Credit :https://paruvellas.wordpress.com/2012/08/13/to-debug-ax-service-operations-framework/

 

 

Tags: , , ,

How to enable document handling button in dynamics AX 2012 form footer/status bar

Today i will demonstrate about how to enable document handling button in ax 2012 form.

document-handling

Let take an example of form Route Operations  where document handling button is not enabled.

cust-group

The document handling button on status bar works on three parameters which should be true for every form in AX to have the document handling button.There are 2 steps must be done on form design to bring the document handling button on Route Operations form.

1.Go to design section on form and change the style property to Auto from SimpleList.

2.Set the StatusBarStyle property to Auto from Simple.

The third parameter is user specific,one should enable the document handling checkbox on option form(Tools->Options->Status Bar).

status-bar-form

Now You are ready to go.

route-opeartions

Important Note From MSDN:

statusbarstyle

Happy Daxing 🙂

 

Tags: , , , , ,

How to select multiple records from lookup-Part-1(SysLookupMultiSelectCtrl)

Today i would share how to create a lookup to select multiple items in Dynamics AX 2012 forms.

In normal lookup methods we can only select one item at a time but in AX 2012 has introduced new class SysLookupMultiSelectCtrl to achieve the same without any hassle.

There are multiple ways to achieve the same but today i will demonstrate how can we have a site lookup with provision to select more then one item selection on parameter form in dynamics ax.

Multiselect lookup.png

Steps:

  1. Create a Query named InventSiteQR that will contains data source e. InventSiteas shown in the below figure.

QueryMultiple lookup.PNG

2.Create the control on the form, set the auto declaration property to yes

Multiselect lookup

3.Declare instance of class SysLookupMultiSelectCtrl In the Class Declaration of the form:

public final class FormRun extends ObjectRun
{
 SysLookupMultiSelectCtrl msCtrlSite;
}

 

4.Write below code in the Init method of the form:

public void init()
{
 msCtrlSite = SysLookupMultiSelectCtrl::construct(element, SplitCostingProd, 
querystr(InventSiteQR),false, [tableNum(InventSite), fieldNum(InventSite, SiteId)]);
}

5.Add new field container type on parameter table named InventSiteCon

6.Write below code on the active method of form parameter table data source to update the control on load of the form:

public int active()
{
if(ProdParameters.InventSiteCon)
 msCtrlSite.set(ProdParameters.InventSiteCon);
 else
 msCtrlSite.set(conNull());
}

7.Write below code on the modified method of form control to get the selected record values from lookup and update those values to parameter Table:

public boolean modified()
{
 boolean ret;
 container conSite;
 RefRecId recid;
 int i;
 InventSite inventSite;
 container roleIds, roleNames;

 ret = super();
 conSite = msCtrlSite.get();
 for(i = 1;i<=conLen(conSite);i ++)
 {
 recid = conPeek(conSite,i);
 select firstOnly inventSite where inventSite.RecId == recid;
 if(inventSite.RecId)
 {
 roleIds += inventSite.RecId;
 roleNames += inventSite.SiteId;
 }
 }
 ProdParameters.InventSiteCon = [roleIds,roleNames];
 return ret;
}

 

Thats it. Happy Daxing 🙂

 

Tags: , , , , , ,

Disable Form grid column automatic sorting feature

I have been asked by customer to enable sorting only on one field and one should not be able to sort by using other grid fields/controls.

in simple words he wants me to disable automatic sorting feature on other fields on grid except one so that when the user clicks the column header, the order displayed would not change.

i found dynamics community conversation to achieve this quick manner.I have added an override method sort() on each grid control where i wants to disable automatic sorting and also blocked super.

sort method

 

public int sort(SortOrder _sortDirection)
{
 int ret;

 //ret = super(_sortDirection);

 return ret;
}

 

Happy Daxing 🙂

References :
How can I disable the automatic sort on the grid?
Preventing users from sorting a grid

 

Tags: , , , , ,

Fill color in Grid records based on condition flag in AX

My client requirement was to change the grid row’s color in dynamics ax 2012 on the condition basis.

There is a method displayOption() method on a form data source which can be useful to highlight particular rows on grid, based on the data in the record. displayOption() method will execute once for each record before the record is displayed on the form.

public void displayOption(Common _record, FormRowDisplayOption _options)
{
 #define.DeepSkyBlue(0, 191, 255)

 if (_record.(fieldnum(ProdTable,ProdStatus))==ProdStatus::ReportedFinished)
 {
 _options.backColor(WinAPI::RGB2int(#DeepSkyBlue));
 }

 super(_record, _options);
}

Happy Daxing 🙂

Reference :
Highlighting record in Grid

How to change grid row color in listpage form in Dynamics Ax 2012

 

Tags: , , , , , , , ,