Skip to main content

Posts

Showing posts from February, 2015

Passing parameters to another form and open it in Edit mode

Below code can be used to pass one parameter from one form to another and open that form in Edit mode. FormRun         formRun; Args            args; str              defaultFormOnTable; MenuFunction    menuFunction; args = new Args(); args.record(CustTable::find(‘test account’)); menuFunction = new MenuFunction( menuitemDisplayStr (CustTable), MenuItemType::Display); if (menuFunction) {           menuFunction.openMode(OpenMode::Edit);    formRun = menuFunction.create(args);    if (formRun)              formRun.run();      } In this example I opened customers form in Edit mode by passing customer account 'test account'as a paramete...

How to validate Email and URL through X++

With default functionality in AX, Email address and URL can be of any format and these do not get validated as per their respective correct formats. Existing functionality Accounts receivable | Common/Customers | All customers | Customer form | Under Contact information fast tab Someone can put Email address in any format as I did "faisal" which is not a correct format of email address. Same applies for URL under contact information for customers. Customized functionality I created a new class with two static methods to validate these attributes as follows by taking concept from this blog post /// <summary> ///    Class to validate Logistics Electronic Address using Regex /// </summary> class  LogiscticsElectronicAddressValidator { }   /// <summary> ///    This method accepts a EMail and validates this using REGEX /// </summary> /// <returns> ///    true or false ...

Random number generation through X++

AX has buit-in functionality to generate random numbers. You can use Random class (a kernel class, not visible in AOT) for this purpose. There are two more ways to generate random number in X++ One is using RandomGenerate Class which extends Random class and generates values within specified range; Second is using xGlobal::randomPositiveInt32() method. Example using Random class to generate random numbers (All in CAPITAL letters) public str generateRandomCode() { str pass=''; int length, counter, randInt,randAscii; ; length = 4; for(counter = 1; counter <= length; counter++) { randInt = Random.nextInt(); randAscii = randInt mod 91; if((randAscii >= 48 && randAscii <= 57) || (randAscii >= 65 && randAscii <= 90)) { pass += num2char(randAscii); continue; } else { randAscii = randAscii mod 26 ; randA...

Exchange rate cannot be found for exchange rate type default between currenies USD & NZD

I came across this error while making some international payments in AX using EFT (method of payment). "Exchange rate cannot be found for exchange rate type default between currenies USD & NZD" Resolution: Go to General Ledger | Setup | Currency | Currency exchange rates Add new exchange rates for required currencies with start date Simple :)

Firewall settings for Microsoft Dynamics AX components [AX 2012 R2]

If you use Windows Firewall to help protect your computers, Microsoft Dynamics AX components require the settings in the following table. For more information about Windows Firewall, see the Windows documentation. Document  is available to download.

Configure Visual Studio to connect/open with correct AOS

Visual Studio is essential to create/edit SSRS reports with MS Dynamics AX 2012 and later releases. Here are steps to configure visual studio with correct AOS (in my case it is development AOS). Connect with computer where visual studio is installed Go to location where visual studio file is installed and placed. In my case it is placed at C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE Right click and sent to create shortcut to desktop (one can create shortcut anywhere) Right click Visual Studio shortcut (will name something "devenv - shortcut") and take properties Set target =  "C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe" /AxConfig C:\FaisalFareedWorkfolder\DynamicsAXTestSystem.axc Path of the original visual studio installation file as mentioned in step 2 "C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe" Path of the configuration file where MS Dynamics AX 2012 configuration is store...

Running AX 2012: "An invalid directory structure for Microsoft Dynamics AX was detected"

I came across an issue recently when I tried to run Dynamics AX 2012 from client configuration file on 32-bit operating system. Client configuration file was created on 64-bit operating system and was copied to 32-bit operating system computer to use. As error says it tries to bind directory at path C:\Program Files (x86)\Microsoft Dynamics AX\60\\Client\Bin which was not exist on 32-bit operating system. Resolution 1 Open client configuration (.axc) file in notepad and change the path at the very end of file. This path should match your directory structure in computer. Source computer (64 bit) configuration will look like this. 64-bit operating system generated configuration file Destination computer (32 bit) configuration should look like this. This is the correct path as per 32 bit computer directory structure. Save configuration file after correcting the paths. It will work smoothly. Resolution 2 http://blogs.msdn.com/b/emeadaxsupport/archive/2011/03/...

The target prinipal name is incorrect - SSRS with AX

Following error made me worried when I was not able to run (existing or customized) SSRS reports from AX. Reports were working fine few days back and there wasn’t a single change done neither at report server nor with AOS service accounts. After digging into issue, came across the issue was services and services groups in AOT. My AOS was connected with TFS and when I got latest from TFS it affects SRSFramework and SSASFramework services and there was some sort of reference lost in service groups. Resolution: Generate FULL CIL Confirm the Business proxy account and AOS service account is same Register SRSFrameworkService and SSASFrwameworkService services from AOT Deploy BIServices and UserSessionServices groups from AOT Restart SQL reporting services