RSS

Author Archives: Deepak Kalra

About Deepak Kalra

Technical Lead Senior Consultant in Dynamics AX(2012,2009,4.0,3.0)

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: , , ,

Reset Production order status through x++ code

My Dynamics Space

On recent enhancement there was a scenario that for some condition I need to reset the production order status from Estimated/Scheduled to created and need to delete the production order. The reference to this production order also should be removed from sales order.

I wrote the following code

Try

{

ttsBegin;

ProdTable = prodtable::find(_prodId, true);

If (prodTable)

{

prodTable.prodStatus = ProdStatus::created;

if (prodTable.validateWrite())

prodTable.update;

}

ttscommit;

}

Catch(exception::error)

{

checkFailed(strFmt(@”Delete of Production order %1 is failed.”, _prodId));

}

after resetting this I deleted the production order using delete_from and it deletes the coproduct records too.

I thought it worked fine. But actually it deletes the Production line reference from inventory transaction and not co-product reference from inventory transaction. Filter the production order that was reset recently in IM > Inquiries > Transaction. you can see the co-product reference is not deleted.

So I debugged more and I found the right code…

View original post 102 more words

 
Leave a comment

Posted by on April 23, 2018 in Uncategorized

 

[D365/AX7] How to: Create simple Dialog using RunBase

[D365/AX7] How to: Create simple Dialog using RunBase

DAX Beginners

A few years ago, I made a post about How to: Create a simple Dialog through X++, today I will review my code and make it work on D365FO.

View original post 98 more words

 
Leave a comment

Posted by on April 23, 2018 in Uncategorized

 

Filter Invent On -Hand based on WMSLocation

DYNAMICS AX SOLUTIONS

Today I have faced a issue how to show or filter data on InventSum Grid in EP from WMSLocation i.e. for each location there should be Invent On-hand data.

Same as AX 2012 R3 rich client in EP.

For these following are the steps:

  1. Create a Dataset EPInventGridOnHand.
  2. Add InventSum and InventDim table in datasource of EPInventGridOnHand dataset.
  3. Now on init() method of EPInventGridOnHand dataset we will get WMSLocation buffer with InventLocationId and WmsLocationId field value and write below code before dataset Init method super()

switch(element.args().dataset())

{
case(tableNum(WMSLocation)):
wmsLocation = element.args().record(); // Here wmsLocation is a global table buffer
break;
}

For filtering based on WMSLocation write below code after dataset init method super()

               //Filter Invent On-hand based on WMSlocation

inventDim_ds.query().dataSourceTable(tableNum(InventDim)).addRange(fieldnum(InventDim,wmsLocationId)) .                                   value(queryValue(wmsLocation.wMSLocationId));

inventDim_ds.query().dataSourceTable(tableNum(InventDim)).addRange(fieldnum(InventDim,InventLocationId)) .    …

View original post 55 more words

 
Leave a comment

Posted by on March 9, 2017 in Uncategorized

 

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: , , ,

SSRS Tip: Printing Row headers in every page – Dynamics Ax 2012

Casperkamal's Dynamics Ax blog

This post today will discuss how to print row headers in every page for tablix.

When your table has a header

When using table type tablix with headers as seen in the below image, right click on the Tablix properties and select “Repeat header rows on each page” (If you use a matrix control please check the same for “Repeat header columns on each page”)

RepeatHeader

When you use a static tablix member in Row or Column.

If you don’t realize what a static tablix member, select a table and insert a row using the option “Outside Group – Above” or simply Insert Row -> Above if you don’t have any groupings. Now open the Group mode window (if not open, click the grouping icon from your report tool bar grouping_windo) and then click Advanced mode. The system will show up static members in a table. These are members that are…

View original post 180 more words

 
Leave a comment

Posted by on November 29, 2016 in Uncategorized