Monday, October 28, 2013

CIL Error and Solution in Dynamic AX 2012

CIL generation: Value cannot be null. Parameter name: parameterTypes
  • If that syntax you have, and you already fix it the object in AOT, but the error still same you must doFull Compile AOT (this is too much consuming time :( ) 

CIL generation: The given key was not present in the dictionary.

when you have the syntax above please do following step :
  1. Increment CIL (this is less consuming time :D )
  2. Full Compile AOT (this is too much consuming time :( )
  • with this step number one, you will find an error, and then you can fix it the error, and try increment CIL again
  • but if the error still raise you can find the log file in C:\Program Files\Microsoft Dynamics AX\60\Server\MicrosoftDynamicsAX\bin\XppIL and it is called Dynamics.Ax.Application.dll (do compiling object in the log file, and try to fix the error on it. and start CIL Increment again. source link is : http://axfaq.blogspot.ro/2012/07/log-files-ax-2012-different-log-files.html
 In my experience this will happen when you have cripple method, function or object in AOT. for mine if above step does'nt work. i willl do following step :

  • Just export the object that maybe contain the error, my favorite is class, export with option layer on it. Open the xpo with some text editor, and find the object in AOT and compile it, and fix it when the error raise it, and do increment CIL again.

READ MORE - CIL Error and Solution in Dynamic AX 2012

Thursday, September 05, 2013

Refresh from after calling method

Refreshing a Form with a Single Root Data Source

To refresh a parent form, you can often use a task to refresh the form. You should use a task when the form has a single root data source. For example, the CustTableListPage, SalesTable, VendTable, and HcmWorker forms all have a single root data source. When you use a task to refresh the form, you cause a call to the research method for all data source tables associated with the form.
To update the form root data source

In the AOT, expand Forms, find the dialog or drop dialog form that you want to work with. Expand the form node.
Right-click the Methods node, click Override method, and then click closeOK. The method opens in the code editor.

Use the FormRun class together with the #taskF5 refresh task to refresh any form that opens this dialog or drop dialog form.
The following code example shows how to get a reference to the calling form and how to refresh that form. Notice how the formRun instance is populated with a reference to the calling form. Also notice how #taskF5 is used to force a refresh of the specified form.
X++
public void closeOk()
{
#Task
FormRun formRun;

super();

// Get an instance of the calling form.
formRun = element.args().caller();

// If the caller is a form, refresh that form.
if(formRun)
{
formRun.task(#taskF5);
}
}


In the code editor, press the compile button. When compiling is finished, close the code editor.

Right-click the form and then click Save.

To refresh the parent form, open the form you use to call the dialog or drop dialog form where you added the previous code. Select a record, open the dialog form, and make a change to a field that appears on the parent form. Click OK to close the dialog form. The parent form is refreshed and shows the value that you updated in the dialog form.
Refreshing a Form with Multiple Root Data Sources

The form that opens your dialog or drop dialog form might have multiple root data sources. For example, the smmActivities form has two root data sources. If you have more than one root data source, you should refresh the data source that includes fields that were updated by using the dialog or drop dialog form.
To find and update a specified root data source

In the AOT, find the dialog or drop dialog form that you want to work with. Expand the form node.
Right-click Methods, click Override method, and then click closeOK. The method opens in the code editor.
Use the FormRun class to get a reference to the calling form. You then have to iterate the list of root data sources to find the data source table that include the fields you updated in the dialog or drop dialog form. You must know the name of the root data source table.
The following code example shows how to get a reference to the calling form, how to iterate a list of root data sources, and how to use the research method to refresh a specified data source. Notice how the tableNum function specifies the root data source table you want to refresh. Caution
In the example, the target root data source table is named Table1. You would have to change this parameter to the name of the root data source table that contains the fields updated by the dialog or drop dialog form.

X++
public void closeOk()
{
FormRun formRun;
List dsList;
ListEnumerator dsListEnumerator;
FormDataSource formDS;

super();

// Get an instance of the calling form.
formRun = element.args().caller();

// If the caller is a form, find and refresh the specified root data source.
if(formRun)
{
dsList = formRun.rootFormDataSources();

if(dsList && dsList.elements() > 0)
{
dsListEnumerator = dsList.getEnumerator();

while(dsListEnumerator.moveNext())
{
formDS = dsListEnumerator.current();
if(formDS.table() == tableNum(Table1))
{
formDS.research(true);
break;
}
}
}
}
}

In the code editor, press the compile button. When compiling is finished, close the code editor.
Right-click the form and then click Save.
To refresh the parent form, open the form you use to call the dialog or drop dialog form where you added the previous code. Select a record, open the dialog form, and make a change to a field that appears on the parent form. Click OK to close the dialog form. The parent form is refreshed and shows the value that you updated in the dialog form.

sumber : http://msdn.microsoft.com/en-us/library/hh812104.aspx
READ MORE - Refresh from after calling method

Tuesday, August 27, 2013

Interfacing Dynamic AX With Eksternal Database Via ODBC with Batch Processing

When i wrote in this blog, am having difficulty and confuse how to interfacing dynamic ax with eksternal database via odbc..


Why why why.. what is happening in here.. when i execute the code via jobs, the code runs very well and succesfully insert and update the eksternal database.. but when i create runbase batch class and calling the code the syntax error will raise : Unable to log on to the database. [Microsoft] [ODBC Driver Manager] Data source name not found and no default driver specified Object 'OdbcConnection' could not be created.

At Last i finally did it..
For my situation the problem is :
Succes running with jobs because  refers to the fact that you connect to the database through the user logged to the current session. When you run a Job from the AX client, this is executed with the user that runs the current AX client (the one logged to the active session);

Failed to running :
When code is executed from server in a batch job, code is executed through the user that runs the AOS windows service.

So the solutions is.. Eng Ing Eng....
CREATE ODBC WITH AOS ACCOUNT, yes IT Works Trust Me..

if there is question just email me, okay...
READ MORE - Interfacing Dynamic AX With Eksternal Database Via ODBC with Batch Processing

Thursday, May 23, 2013

Upload Financial Dimension Value For Dynamic AX 2012

Here goes the scenario for upload financial dimension value for Dynamic AX 2012

Example : You have financial dimension : Department and you want to insert or add  financial dimension value into it.

here goes the scripts :
static void TCN_DPRcreateDimensionValue(Args _args)
{
DimensionValueService service;
DimensionValueContract dimensionValueContract;
TCN_FinancialDimensionValueTemp dimTemp;


service = new DimensionValueService();
dimensionValueContract = new DimensionValueContract();
try
{
while select dimTemp order by FinancialDimension
{

dimensionValueContract.parmDescription(dimTemp.FinancialDimensionDescription); //financial dimension value description
dimensionValueContract.parmValue(dimTemp.FinancialDimensionValue); //financial dimension value;
dimensionValueContract.parmDimensionAttribute(dimTemp.FinancialDimension); //financial dimension
service.createDimensionValue(dimensionValueContract);
}

}
catch
{
ttsAbort;
}
info("Hore Sukses");
}

Good Luck
Please suit for your needs :D
Dwipa
READ MORE - Upload Financial Dimension Value For Dynamic AX 2012

Thursday, May 16, 2013

SRSS Reporting Format Report Date In Visual Studio 2010 with Dynamic AX 2012

1. Print page number like Page 1 of 2
="Page "&Globals!PageNumber &" of "&Globals!TotalPages

2. Print current date with prefix like Jakarta, 1 April 2013
="Jakarta, " & day(Globals!ExecutionTime) & " " & monthname(month(Globals!ExecutionTime)) & " " & year(Globals!ExecutionTime)

3.Print date with passing parameter from dataset dynamic ax 2012 //ex. param is  InvoiceDate
="Jakarta, " & day(Fields!InvoiceDate.Value) & " " & monthname(month(Fields!InvoiceDate.Value)) & " " & year(Fields!InvoiceDate.Value)

4. Print date without timestamp
=Format(Fields!Start_Date.Value,"dd/MM/yyyy")

5. Print number
=RowNumber(nothing)


6. Print or counting amount of records on table or matrix
=CountRows("Tablix1")

7. Print only one records in row
=IIF(Rownumber("Tablix1") >1,"","Solar Beban LMM")


READ MORE - SRSS Reporting Format Report Date In Visual Studio 2010 with Dynamic AX 2012