Tuesday, September 8, 2015

Enterprise portal add user or group from other trusted domain

I've been dealing with enterprise portal but using cross domain trust when accessing the enterprise portal website. When adding I tried to add users from other trusted domain the Sharepoint didn't recognize the user I tried to add.
To be able to add other trusted domain you can use below Sharepoint powershell:

STSADM.exe -o setproperty -pn peoplepicker-searchadforests -pv domain:"trustedDomain" -url "http://WebApp/"

After execute the powershell script you will be able to add other domain trusted.

Saturday, August 8, 2015

Export Dynamics AX project from Code

Doing a backup for code can be done in many ways for Dynamics AX, one of it is using the xpo backup.
Below is the sample code to export the Project from x++:

static void ExportProject(Args _args)
{
    TreeNode            treeNode;
    ProjectNode         projectNode;
    ProjectListNode     projectListNode;
    TreeNodeIterator    it;
    ;

    projectListNode = infolog.projectRootNode().AOTfindChild("Shared");
    it = projectListNode.AOTiterator();
    projectNode = projectListNode.AOTfindChild("ALL_CUS");
    treeNode = projectNode;
    treeNode.treeNodeExport(@"C:\Tst.xpo");
}

Thursday, May 21, 2015

SSRS report deployment error

A lot of error can pop up when we deploy the report from AX one of them is "User does not have required permissions. Verify that sufficient permissions have been granted and Windows User Account Control (UAC) restrictions have been addressed.", below are some few place that you can check whether it's already being configured properly:
  • Check whether UAC has been properly set up (disable it for the fastest way)
  • Set respective user as administrator in SSRS server.
  • Check whether respective user has access rights to the SSRS folder
The easiest way to resolve this was to add the respective users to the whole SSRS site as "System admin" role on below location at your SSRS report manager

Wednesday, May 6, 2015

Dynamics AX 2012 SSRS changes not reflected after deployment

After we change the report format at Visual Studio and save it; sometimes when we deploy it from AX client it won't reflect the changes. I've spend quite some times to check why it's not reflected. There are few points that you can check :
  • Check whether Visual Studio properly save the report into AX (most cases)
    • Try to close the "Designer" before saving the report
    • Try to "Add to AOT" not only save
  • Deploy the report directly from Visual Studio (fast workaround)
  • Delete all *.auc file at respective users appData folder
You can always "compare" the report to see the changes.

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');
    perm.assert();  
    binData = new binData();
    binData.loadFile(tempFileName);
    imageContainer = binData.getData(); //get the QR code image put inside container so can be stored inside database for storing or reporting purpose

    System.IO.File::Delete(tempFileName);

    CodeAccessPermission::revertAssert();      
}

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\xInfo\add
(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.

Sample:
-<wsdl:operation name="find">
<soap:operation style="document" soapAction="http://schemas.microsoft.com/dynamics/2008/01/services/SalesOrder/find"/>

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.

Tuesday, November 12, 2013

Dynamics AX 2012 R2 software upgrade checklist can't expand on windows server 2012

After we upgrade the AX 2012 R2 into a new CU we need to do the sofware checklist update inside AX as a routine after installing the hotfix or CU. If we open the client and run the software checklist update on Windows Server 2012, the check list item can't expand when we click the expand (+) and if the check list item can't expand then we can't go through the check list process.

I'm not sure what is the missing part here but looks like Windows server 2012 not certified yet for Dynamics AX 2012 R2 client.
To solve this issue we need to run the software update checklist in AX client under supported client OS (I have tested in Windows server 2008 R2 and Windows 7).

Friday, November 8, 2013

Testing out new tools AxBuild.exe from CU7 for parallel compiler

A new tool came out in Dynamics AX 2012 R2 CU7 which is AxBuild. This tool really help us to make the compiler run faster. Here is the screenshot of the parallel compilation using AxBuild.exe.

I have tested my self this tools run in virtual machine and it takes 1 hour 5 mins to do the full compilation.


For more information you can go to this link.
http://msdn.microsoft.com/library/d6da631b-6a9d-42c0-9ffe-26c5bfb488e3.aspx
and
http://blogs.msdn.com/b/axtools/archive/2013/11/04/parallel-x-compilation-for-microsoft-dynamics-ax2012-r2-in-cumulative-update-7.aspx

Thursday, November 7, 2013

Unable to find a unique Dimension code combination record corresponding to the entered values. error in dimension AX 2012

Recently I found an error when I build a SegmentedEntry in another customize form just like LedgerJournalTransDaily form.

"Unable to find a unique Dimension code combination record corresponding to the entered values." (can't find this error in label too)
When I try to debug the error I can't find any clue because this error send the notification after the modified event of the control. (I might miss some of the call stack that lead to this modified event). I tried to look again the standard function and found that I miss something in the "LedgerDimension" datasource field method, the method name is "resolveReference".
Here is the sample method code:
public Common resolveReference(FormReferenceControl _formReferenceControl)
{
    Common common = offsetLedgerDimensionController.resolveReference();

    return common;
}


Sunday, November 3, 2013

Dynamics AX 2012 R2 client crash when doing full compilation on windows server 2012

I don't know what cause this client crash when we do the full compilation of Dynamics AX 2012 R2 on windows server 2012. I just found only few times I didn't get the AX client crash but 90% it will crash.
Some forum in Microsoft said that Windows Server 2012 only certified for the AOS but not for the client.
I have tried do the full compilation for the Dynamics AX 2012 R2 CU1 and CU6; both have the same client crash.

One of the solution that I found is to run the full compilation using Dynamics AX client running on Windows server 2008 (with or without R2) or Windows 7.

Saturday, November 2, 2013

Missing labels after upgrading to AX2012 R2 CU6 or CU7

After you upgrade Dynamics AX 2012 R2 you will find there is a missing label in the software upgrade action in the beginning when you start the AX client.
Here is a link to fix that.
http://blogs.msdn.com/b/axsupport/archive/2013/07/12/missing-syp-labels-after-upgrading-to-ax2012-r2-cu6.aspx


  • Stop AOS
  • Delete *.ald file in the Microsoft Dynamics AX\60\Server\<instance>\bin\Application\Appl\Standard
  • Start AOS

Saturday, September 7, 2013

Dynamics AX 2012 RTM upgrade form freeze

Hi, there is one time I need to do single patch for Microsoft Dynamics AX 2012 (not R2). Once I applied the patch then restart the AOS, open up the AX application then the upgrade form is show up but you can not choose anything, just like a freeze form. I wonder this is bugs from Microsoft or something else.

After I tried many times until I found that you can choose the options from the development environment use parameter -development
Here is the official link from microsoft how to open Development environment.
http://msdn.microsoft.com/en-us/library/gg846350.aspx

Wednesday, July 24, 2013

Inventory master data migration AX 2012

Sometimes using DMF is quite hard if you don't know how to configure and use it, below is the sample code how to do the inventory master from code (not product master).
Actually we can always use standard AX 2012 code to release the product master but we need to configure it again once it's become the inventory master; so below code can help to release the inventory master with pre-configured data that you can define from a CSV file.
We will use help from AIF class InventItemService.
    

Tuesday, July 23, 2013

Customer account number sequence AIF error

Recently I'm facing an error regarding inserting a record from AIF (AX 2012), below are the message:

  • Line=1, Pos=1256, Xpath=/Customer/CustTable[1]/DirParty[1]
  • The number sequence Acco_368 does not allow the Customer account to be defined.


To resolve this issue is to change the customer account number sequence as a manual.

Monday, July 15, 2013

AX 2012 R2 Deployment manage code

Deployment of managed code in AX sometimes will cause an error because it was not installed or signed in the GAC or other reason.

below is the sample for the warning:

The description for Event ID 110 from source Microsoft Dynamics AX cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer.



If the event originated on another computer, the display information had to be saved with the event.


The following information was included with the event: 

Microsoft Dynamics AX Business Connector Session 3.

Failed loading assembly ElectronicFiscalDocument_BR.dll.config 

Do full compilation of AOT and generate full CIL.

If still got the error then you need to open the respective Visual studio project for that assembly, rebuild it and deploy to the server/client/EP