Tag Archives: AX 2012

AX 2012: Error when in SSRS print preview

Error in Microsoft Dynamics AX 2012 Reports Print Preview

The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter http://tempuri.org/:queryBuilderArgs. The InnerException message was ‘Element ‘http://tempuri.org/:queryBuilderArgs’ contains data from a type that maps to the name ‘http://schemas.datacontract.org/2004/07/XppClasses:SrsReportProviderQueryBuilderArgs’. The deserializer has no knowledge of any type that maps to this name. Consider using a DataContractResolver or add the type corresponding to ‘SrsReportProviderQueryBuilderArgs’ to the list of known types – for example, by using the KnownTypeAttribute attribute or by adding it to the list of known types passed to DataContractSerializer.’.  Please see InnerException for more details.

The formatter threw an exception while trying to deserialize the message
Solutions:

Check Inbound Ports in Microsoft Dynamics AX Client.

The formatter threw an exception while trying to deserialize the message - sol

Activate Inbound Ports “BIServices” then try to print reports again.

It also important to activate inbound services as possible.

The formatter threw an exception while trying to deserialize the message - sol 2

 

Advertisements

AX 2012: Convert Base64String to Images File

Convert Base64String to Images files or PNG Files.

In my scenario, I need to read Base64String from other application through web services and save it as images file in my server computer.

 

static void convertBase64ToImages(Args _args)

{

str base64String = ‘XXXXXX-BASE64STIRNG-XXXXXX’;

// Save the image

AifUtil::saveBase64ToFile(@”C:\TEMP\TEST1.PNG”, base64String);

}

 

AX 2012: Post Sales Invoice using X++

AX 2012: Post Sales Invoice using X++

static void postSalesInvoice(Args _args)
{
SalesFormLetter salesFormLetter;
SalesTable salesTable;
SalesId salesId = ‘005063’;
System.Exception error;
str strError;
CustInvoiceJour custInvoiceJour;
;

ttsBegin;
try
{
salesTable = SalesTable::find(salesId);

if (salesTable && salesTable.SalesStatus == SalesStatus::Delivered)
{
salesFormLetter = SalesFormLetter::construct(DocumentStatus::Invoice);
salesFormLetter.update(salesTable, systemDateGet(), SalesUpdate::All, AccountOrder::None, NoYes::No, NoYes::No, NoYes::No, NoYes::Yes);

if (salesFormLetter.parmJournalRecord().TableId == tableNum(CustInvoiceJour))
{
custInvoiceJour = salesFormLetter.parmJournalRecord();
info(strFmt(‘Sales Order #:%1 has been successfully posted and Invoice #:%2 is created!’, custInvoiceJour.SalesId, custInvoiceJour.InvoiceId));
}

}
else
{
info(strFmt(‘%1 does not exsists or null in the system, please try again!’, salesId));
}

}
catch (Exception::CLRError)
{
error = CLRInterop::getLastException();
strError = error.ToString();

info(strfmt(‘%1’, strError));
info(strFmt(‘%1 failed to post, please try again!’, salesId));
}
ttscommit;
}

AX 2012: Post Packing Slip using X++

AX 2012: Post Packing Slip using X++

static void postPackingSlip(Args _args)
{
SalesFormLetter salesFormLetter;
SalesTable salesTable;
SalesId salesId = ‘SO00001’;
System.Exception error;
str strError;
CustPackingSlipJour custPackingSlipJour;
;

ttsBegin;
try
{
salesTable = SalesTable::find(salesId);

if (salesTable && salesTable.SalesStatus == SalesStatus::Backorder)
{
salesFormLetter = SalesFormLetter::construct(DocumentStatus::PackingSlip);
salesFormLetter.update(salesTable, systemDateGet(), SalesUpdate::PackingSlip, AccountOrder::None, NoYes::No, NoYes::No, NoYes::No);

if (salesFormLetter.parmJournalRecord().TableId == tableNum(custPackingSlipJour))
{
custPackingSlipJour = salesFormLetter.parmJournalRecord();
info(strFmt(‘New Packing Slip #:%1 successfully created for Sales Order #:%2’, custPackingSlipJour.PackingSlipId, custPackingSlipJour.SalesId));
}
}
else
{
info(strFmt(‘%1 does not exsists or null in the system, please try again!’, salesId));
}

}
catch (Exception::CLRError)
{
error = CLRInterop::getLastException();
strError = error.ToString();

info(strfmt(‘%1’, strError));
info(strFmt(‘%1 failed to delivered, please try again!’, salesId));
}
ttscommit;
}

AX 2012: Client found response content type of “, but expected ‘text/xml’. The request failed with an empty response.

Error while calling SSRS  Reports in AX 2012

Error Details:

Client found response content type of “, but expected ‘text\xml’. The request failed with an empty response.

The attempt to connect to the report server failed. Check your connection information and that the report server is a compatible version.

Error Screen Shots:

Client found response content type of

 

Solution (Based on my experiences):

  1. Check your Reporting Server, check local drive where your Reporting Server Files are stored. Check if there still available spaces.
  2. In my case, Client found response content type of (sol)
  3. After I cleaned my Local Disk (C:), error is resolved.

AX 2012: Get Exchange Rates

 

Get Exchange Rates in AX 2012

Parameters are CurrencyCode and TransDate.

 

public ExchRate getExchRateFind(CurrencyCode _currencyCode = ”, TransDate _transDate = systemDateGet())
{
ExchangeRateType ExchangeRateType;
ExchangeRateCurrencyPair ExchangeRateCurrencyPair;
ExchangeRateHelper exchangeRateHelper;
CurrencyExchangeRate exchangeRate1;
CurrencyExchangeRate exchangeRate;
;

exchangeRateHelper = ExchangeRateHelper::newExchangeDate(Ledger::current(), _currencyCode, _transDate);
exchangeRate1 = exchangeRateHelper.getExchangeRate1();
exchangeRate = exchangeRateHelper.displayStoredExchangeRate(exchangeRate1);

return exchangeRate;
}

Export Model in AX 2012 using Microsoft Dynamics AX Management Shell

A Model can be export and import into a model store.

Microsoft Dynamics AX Model is a set of elements in a given layer and each layer can be one or more models.

Model can be export to files using Microsoft Dynamics AX Management Shell and it will have .axmodel extensions.

Model exported called Model File or AX Model File.

Prerequisites:

  1. Administrative permissions on the local computer.
  2. System Administrator rights in Microsoft Dynamics AX.
  3. In Microsoft SQL Server:
    • Membership in the Securityadmin server role on the SQL Server instance.
    • Membership in the db_owner role in the Microsoft Dynamics AX database.

Procedures:

  1. Open Microsoft Dynamics AX Management Shell, Go to Start Menu > All Programs > Administrative Tools > Microsoft Dynamics AX Management Shell.
  1. At the Windows PowerShell command prompt, PS C:\>, type the following command, and then press ENTER.
    AX Management Shell:
    Export-AXModel –Model <name> -File <Filename.axmodel> 
    Example:
    Export -AXModel -Model "USR Model" -File C:\USR.axmodel
    
    Export Model AX2012
    
    Wait until it finished...
    
    Export Model AX2012 - Exported
    
    AX model files should be save and placed in C:\USR.axmodel
    
    Export Model AX2012 - Exported Location
    
    

     

    You can use the –Server, –Config, or –Database parameters to specify the environment to export from.

    You can also use the -Key parameter to specify the strong-name key pair file to use to sign a model.

    For more information, see Export-AXModel

Management Reporter Configuration Console Stopped working – Unexpected end of file.

Event Viewer Error (Image 1)

Error:

Unexpected end of file.

Machine: XXXXXXXXXX

1

**************************

Event Viewer Error (Image 2)

Error

Faulting Application name: MRConfigureConsole.exe, version: 2.12.140001.45 time stamp: 0x564f9134

Exception code: 0xe0434352

3

 

*******************************************

Event Viewer Error (Image 3)

Error:

Application: MRConfigurationConsole.exe

Description: The process was terminated due to an unhandled exception.

Exception Info: System.Xml.XmlException

 

2

 

****************************SOLUTION********************************

Solution:

Go to this path:

C:\ProgramData\IsolatedStorage\<XXX.XXX>\<YYY.YYYY>\

Check all the folder “Publisher.<XXXXXXXXX>” one by one. Go inside the folder and you can find “AssemFiles” Folder open it and you can find “DeploymentContext.txt” inside.

Right Click  and Open “DeploymentContext.txt”, If you see it’s empty delete it and if have something text inside just leave it as it is.

Note: Delete “DeploymentContext.txt” only when it’s empty to the whole Folder.

After you validated all the “Publisher.<XXXX>” Folder, Try to run the Configuration Console again and it should be working as normal.

 

If this help you, please like or put some comments below.

Thank you,

 

 

 

Error while connecting to Management Reporter 2012 CU13

Error Messages:

System.ServiceModel.EndpointNotFoundException: There was no endpoint listening at http://Server:4712/InformationService.svc that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details. —> System.Net.WebException: Unable to connect to the remote server —> System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 192.168.123.40:4712
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.GetRequestStream(TransportContext& context)
at System.Net.HttpWebRequest.GetRequestStream()
at System.ServiceModel.Channels.HttpOutput.WebRequestHttpOutput.GetOutputStream()
— End of inner exception stack trace —

Server stack trace:
at System.ServiceModel.Channels.HttpOutput.WebRequestHttpOutput.GetOutputStream()
at System.ServiceModel.Channels.HttpOutput.Send(TimeSpan timeout)
at System.ServiceModel.Channels.HttpChannelFactory`1.HttpRequestChannel.HttpChannelRequest.SendRequest(Message message, TimeSpan timeout)
at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at Microsoft.Dynamics.Performance.Reporting.Security.IInformationService.HostIdentity()
at Microsoft.Dynamics.Performance.Reporting.Common.Service.ClientBase.<>c__DisplayClass8`1.<Execute>b__5()
at Microsoft.Dynamics.Performance.Reporting.Common.Service.ClientBase.<>c__DisplayClass8`1.<Execute>b__3(Func`1 T)
at Microsoft.Dynamics.Performance.Reporting.Common.Service.ClientBase.<>c__DisplayClass8`1.<Execute>b__4()

MR 2012 CU13 -There was no endpoint listening

Solutions:

The port used during the MR installation is not set up as an exclusion within the Firewall software.

Follow the following steps:

Setup an exception in your Firewall program. Steps will vary depending on the Firewall program used but here are high level steps.

  • Click Start and then click Run.  Type WF.MSC and then press Enter.
  • Click Inbound Rules.
  • Click New Rule.
  • Click Port and then click Next.
  • Click Specific local ports and then type 4712. If you are not using the default port of 4712, you will need to type that here. Click Next.
  • Click Allow the connection and then click Next.
  • Select Domain, Private, and Public.  Click Next.
  • Type Management Reporter as the Name and then click Finish.

MR 2012 CU13 -There was no endpoint listening - Sol 1

AX 2012 R3: Assembly containing type Microsoft.Dynamics.AX.Framework.Tools.DMF.ServiceProxy.DmfEntityProxy is not referenced

Error Message:

Assembly containing type Microsoft.Dynamics.AX.Framework.Tools.DMF.ServiceProxy.DmfEntityProxy is not referenced.

Data Import Export Framework Parameters

I got above error when I clicked Data import/export framework parameters under Data import export framework > Setup > Data import/export framework parameters.

Solutions:

I resolved error by doing the following:

  1. Stopped AOS Instances services.
  2. Backup “XppIL” folder under this path: (C:\Program Files\Microsoft Dynamics AX\60\Server\[AOS Instance Name]\bin\XppIL)
  3. After backup XppIL Folder, I deleted all the files inside XppIL folder. Note: This will regenerate when AOS Services started.
  4. Start AOS Instances services.
  5. Open Microsoft Dynamics AX Client and check again if error still exists.

Note: Solution provided was based on my experienced and will not guaranteed that will works same in your problems.