Tuesday, March 31, 2009

how to pass the parameter form form a to form b

I have two forms, Form1 and Form2. I call the Form2 on the click event of button from Form1. Now, from Form2 I want some values to be transfered to Form1. How would I do that?

I can easily pass value from Form1 to Form2 using:

args.parm("hello" );

and can get value on Form2 using:

info(element. args().parm( ));

But how would I pass value from Form3 to Form1? How can I pass more than one values from Form3 to Form1?

You can use args.parmObject( ) to pass object as a parameter,
or pass reference of form1 by args.caller( )

Thursday, March 5, 2009

How to create a crash dump for Axapta processes ?

All clients lose connection to the AOS Server. If the Axapta AOS or client process crashes for any reason, it is recommended to create a crash dump, of the failing process.

Here are the steps to do so:

  1. Download the Microsoft debugging tools, from here: 
    http://www.microsoft.com/whdc/devtools/debugging/installx86.Mspx 
    The 64-bit Version is available here: 
    http://www.microsoft.com/whdc/devtools/debugging/install64bit.mspx
  2. Install the debugging tools on the problem machine.
  3. Switch to the install folder of the debugging tools using the command line.
  4. Attach the tracing tool(adplus) to the crashing process. 
  5. Use the following command line options to attach the debugger. 
    adplus –crash –pn ax32.exe
    adplus –crash –pn ax32serv.exe

    or
    adplus –crash –p 

    To enable the Process ID, go to Task Manager\View\Select Columns… 
    PID (Process Identifier)
  6. Now the tracing tool is active and should generate a crash dump, once the process  crashes.
  7. You will find the dump file in the installation folder of the debugging tools.
  8. A correct crash dump file should look like this: 
    PID-4580__AX32.EXE__2nd_chance_UnknownException__full_1810_2008-12-04_20-53-48-528_11e4.dmp 
    Please focus on the 2nd_chance in the title. Please reattach the tracing tool again in case you get only 1st_chance exception, or just a log file(has a *.log extension). 
    Example: 
    example1 
  9. Once you have created a second chance crash dump file, send it to the Microsoft MBS support to get the file analyzed in detail.

Creation of new financial dimension

Many a times there is requirement from many customers to create a new financial dimension in AX apart from the three standard dimensions "Department", "Cost center" and "Purpose". Here is a step by step description of creating a new financial dimension.
 
To create a new financial dimension modify following objects one by one
 
    • Base enum "SysDimension" : Find this base enum and right click on this base enum -> Select option "New element". In properties window give a name to this element say "TestDim" and label as "Test dimension". Save the base enum.
    • Extended data type "Dimension" : Find this EDT and then add a new array element in this EDT. Name this array element as "TestDim". In properties window specify label as "Test dimension". Now in the "Relations" tab of this new array element add a new "Normal"  relation first. To this normal relation open properties window and set property Table as "Dimensions" and Related field as "Num". Now add another relation of type "Related field fixed". To this related field fixed relation open properties window and set Related field as "DimensionCode" and property value as "3" (this is the value of the new enum element created in SysDimension). Save the EDT.
    • Extended data type "DimensionCriteria" : Repeat the process of modification as done for EDT "Dimension" above.
    • Extended data type "XMLMapDimension" : Find this EDT in AOT and then create a new array element for this EDT. Label this array element as "Test document value". Save the EDT.
    • Extended data type "MandatoryDimension" : Find this EDT in AOT and then create a new array element for this EDT. Label this array element as "Validate test dimension". Save the EDT.
    • Extended data type "DimensionLedgerJournal" : Find this EDT in AOT and then create a new array element for this EDT. Label this array element as "Test dimension". Save the EDT.
    • Extended data type "DimensionKeepFromTransaction" : Find this EDT in AOT and then create a new array element for this EDT. Label this array element as "Keep transaction test dimension". Save the EDT.
    • Extended data type "COSAllowDimensions" : Find this EDT in AOT and then create a new array element for this EDT. Label this array element as "Test dimension". Save the EDT.
    • Extended data type "DimensionPriority" : Find this EDT in AOT and then create a new array element for this EDT. Label this array element as "Test dimension". Save the EDT.
    • Extended data type "DimensionAllocation" : Find this EDT in AOT and then create a new array element for this EDT. Label this array element as "Test dimension". Save the EDT.
    • Table "LedgerJournalTrans" : Find this table in AOT and add a new relation in the relations tab as follows. Create a new relation in relations tab and name it as say "interCoDimension3" (You can see three more similar relations with suffix 0, 1 and 2 for three standard dimensions). Now set the property table of this relations as "Dimensions". Create a new "Normal" relation under this realtion tab and set the property "Field" = "OffsetCompany" and property "RelatedField" = "dataAreaId". Create another "Normal" relation under this relation tab and set the property "Field" = "InterCoDimension[4]" and property "RelatedField" = "Num". Now create a new "Related field fixed" relation under this tab and set property "Value" = 3 (this is the value of the new enum element created in SysDimension) and property "Related field" = "DimensionCode". Save the changes.

The new financial dimension is successfully created in AX and can be viewed in different forms through out the AX where ever dimensions are used.

How to identify the user that was used to change an object from AOT in AX2012

Get the object name for which we need to track these (user and date&time) information's. Login to SQL Server Management Studio an...