Wednesday, October 22, 2014

Enterprise portal error in Dynamics AX 2012 R3

Below error was a common error that can happen in Dynamics AX 2012 R3 EP, sometimes we hardly know what was missing or not configured properly:
  • You cannot view data on this page because you are not a registered user in Microsoft Dynamics AX. Contact your Microsoft Dynamics AX administrator.
  • No .NET Business Connector session could be found.

Here are some point that you might need to check
  • Make sure the necessary inbound services was running
  • Make sure BC connector been configured properly

Action that you might try:
  • Re-create the AX user account (delete and import again the AX users)
  • Delete and register/add again the EP website manually (System administration - Setup - Enterprise portal - Web site) [this one will always works for me for the 1st error point]

Tuesday, August 5, 2014

Generate QR barcode in Dynamics AX 2012

I just realize that Dynamics AX 2012 already provided the QR code generation under "C Sharp Projects" nodes

Below is the sample code how to use it

static void QRBarcode(Args _args)
    Microsoft.Dynamics.QRCode.Encoder   qrCode;
    System.String                       netString;
    str                                 tempFileName;
    System.Drawing.Bitmap               netBitmap;
    Bitmap                              imageQR;
    FileIOPermission    perm;  
    BinData             binData;
    container           imageContainer;  
    netString = "TEST";  
    qrCode = new Microsoft.Dynamics.QRCode.Encoder();  
    netBitmap = qrCode.Encode(netString); //encode the string as Bitmap can be used already
    tempFileName = qrCode.GetTempFile(netString); //to get the QR temporary file
    perm = new FileIOPermission(tempFileName,'r');
    binData = new binData();
    imageContainer = binData.getData(); //get the QR code image put inside container so can be stored inside database for storing or reporting purpose



By using the code above we don't need to put another 3rd party software to generate the QR bar code.

In standard AX process this QRCode function has been used to generate the E-Invoice QR bar code.

Sunday, June 22, 2014

Immediately get the table relation in form advance query

Adding a relation in the table sometimes is not enough to get the linkage table in the advance query/filter in the form, we still need to the cross reference update to make the table linkage immediately available at the advance query/filter in the form.

Friday, May 9, 2014

A currency to convert from is required to retrieve exchange rate information error

An error regarding currency information sometimes very hard to get a hint where is the missing part, below is one of the error for currency when you execute the "Order line not invoiced" report in Microsoft Dynamics AX 2012 R2.
I have had check in the transaction all of them using base currency but still hit this error.

A currency to convert from is required to retrieve exchange rate information.
(S)\Classes\Info\add - line 94
(S)\Classes\Global\error - line 3
(S)\Classes\ExchangeRateHelper\handleError - line 23
(S)\Classes\ExchangeRateHelper\validateFromCurrency - line 6
(S)\Classes\ExchangeRateHelper\getExchangeRate1 - line 24
(S)\Classes\CurrencyExchangeHelper\calculate - line 42
(S)\Classes\CurrencyExchangeHelper\calculateTransactionToAccounting - line 21
(S)\Data Dictionary\Tables\Currency\Methods\mstAmount - line 20
(S)\Classes\Tax\amountExclTax - line 187
(S)\Classes\Tax\baseAmountExclTax - line 132
(S)\Data Dictionary\Maps\SalesPurchLine\Methods\amountExclTax - line 100
(S)\Data Dictionary\Tables\SalesLine\Methods\amountExclTax - line 3
(S)\Data Dictionary\Maps\SalesPurchLine\Methods\lineAmountExclTax - line 25
(S)\Data Dictionary\Tables\SalesLine\Methods\lineAmountExclTax - line 3
(S)\Classes\SalesNotInvoicedDP\getFromSalesLine - line 12
(S)\Classes\SalesNotInvoicedDP\processReport - line 21
(S)\Classes\SrsReportProviderQueryBuilder\initialize - line 59

The reason of this error is because of the AX system can't find the exchange rate within the date of transaction.
You can fix this by filled in the currency exchange rates within the range of the transaction date (for each of the currency exchange rate)

Thursday, January 23, 2014

AIF Web service error

AIF that hosted in web service sometimes cause an error that very hard to trace, below is one of the error generated when we accessing the AIF webservice.

The server was unable to process the request due to an internal error. For more information about the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the <serviceDebug> configuration behavior) on the server in order to send the exception information back to the client, or turn on tracing as per the Microsoft .NET Framework 3.0 SDK documentation and inspect the server trace logs.

After a long time search also enable the debugging, I found that the NameSpace in the services is not properly update. So if you guys encounter this error please make sure the NameSpace define in AX is the same with the NameSpace that been generated in the web services.

-<wsdl:operation name="find">
<soap:operation style="document" soapAction=""/>

The bold character is the namespace, make sure that its the same with the name space in the AX services object.

Note: this is only one of the possibilities for the respective error message.