Saturday, June 25, 2011

Place to put range in data source

Sometimes, without much thinking we tend to change query of a form data sorce this way :
1. Put in the init method of datasource, after super() the range that will be applied to that table’s datasource.
2. Let the system retrieve the default query.
3. In the run method, which is after system generated query is executed, apply the range and then call the datasource.executeQuery again.

This is inefficient because of two things :
1. The data source query is executed two times, in which the first one is never used. This is a waste of resource.
2. When this form is a master table, go to main table will not work with this approach because go to main table is erased by the second exec ute query.

Better approach will be to follow standard AX InventJournalTable, where range query is applied before super() in the datasource.executeQuery method.
This will make sure only one execute query is needed (which is more efficient) as well as it will regard the go to main table.

Thursday, September 30, 2010

SysReportLibraryExport syntax error

I was installing the following scenario :

AOS Server :
Windows 2008 R2

Database Server:
Windows 2008 R2
SQL Server 2008


After install reporting extension I got the following error when run AxPatch.exe as suggested in this procedure.

Error executing code: SysReportLibraryExport (object) has no valid runable
code in method 'new'.
(C)\Classes\SysReportLibraryExport\new

I tried compile the class from AOS server, it is error.
It turned out that I had to compile the class by opening Ax client from database server as there is where the reporting extension is installed.

Thursday, September 9, 2010

Install SQL Server Management Studio and other tools

Once I came across a situation where my SQL Server installation did not complete on the client components part. It was due to the virtual pc unable to locate the CD 2 needed for the installation. The database service was installed but no client tools.
So I need to figure out how to install the client components only.
Toos > Setup > SQLRun_Tools.msi.


Wednesday, May 26, 2010

PO Posting error after crash

After an application hung, purchase order invoice failed with the following error message :

One or more pending invoices cannot be displayed because they are in use.

Here is how to to get rid of it.

Go to Account Payable > Inquiries > History > Purchase Order > Invoice (Other document status may click on respected menu item).

Perform advanced filter, put this filter :
PurchParmTable.purchid = <purchid>
PurchParmTable.status = Pending.

Click OK.
Delete the record.

Now posting invoice should work.

Agus

Wednesday, May 19, 2010

Create new role center in Dynamics Ax 2009

Compiled from Dynamics Ax Developer help for quick reference.
  1. Open Dynamics Ax enterprise portal (default installation is http://servername/sites/DynamcisAx).
  2. Click on Site Action > Create . Choose Web part page (as most Ax role center using this). Complete the page creation.
  3. Open Ax client > AOT > Web > Web menu item > URLs > New URL.
  4. Specify URL Properties by clicking on the elipsis button. Browse Enterprise portal folder and choose the .aspx page created in the step 2.
    If got error go to here.
  5. Set home page property to YES. (If not the page will not be available to be chosen as user profile role center page).
  6. Right click > Import. This will import the page to AOT under web > web files > page definitions.
  7. Locate the new page definition on step 6. Set the page title properties.
  8. Go to Admin > Setup > User profile. Create a new record. Choose the role center column from drop down.
  9. Click view role center button to test.

Wednesday, November 11, 2009

Dynamics AX 2009 workflow error

I have faced several problem getting workflow to run in Ax 2009.
Here is check list of what to look when workflow doesn't work like a flow.

- Reinstall .net business connector.
- Check that the IIS website where workflow reside is running
- Check that app pool used by workflow website is running
- Check that app pool used by workflow has identity the same with domain user set as business connector proxy account in ax (Admin > Setup > security > System service account > Business connector proxy).
- Check that there are two bath job : workflow message processing and workflow due date expiration in the basic > inquiry > batch job. If they don't exist or have problem, delete and create again using workflow configuration wizard (Admin > setup ).
- Else ? Please add.

Tuesday, August 25, 2009

Force delete inventtrans

Below is sample job to force delete inventtrans, which will take care of invent on hand update.
static void DeleteInventTrans(Args _args)
{
Dialog dlg = new Dialog("Delete inventtrans ?");
DialogField dlgFld;
InventMovement inventMovement;
PurchLine purchLine;
PurchLineRefRecId recId;
;

dlgFld = dlg.addField(typeid(PurchLineRefRecId));
if(dlg.run())
{
recId = dlgFld.value();
purchLine = PurchLine::findRecId(recId);

if(purchLine)
{
InventMovement = InventMovement::construct(purchLine);
InventUpd_DeleteMovement::newMovement(
inventMovement,true).updateNow();
info("done");
}
}

}