Saturday, March 19, 2011

Invalid sort field in hour forecast form of ax 2009

Hi All,

In an implementation where I am working with india localization I found there are a lot of bugs in standard AX and some have moved as it is in AX 2012 as well. The bug that I am talking about can be regenerated as
Project details form -> Forecast button -> Hour ->  Hour forcast form -> Overview tab -> Activity number column. When one tries to click and go to main table form it generates an error "Invalid sort field".
I gave a workaround to my client for this option and opened the main form(Activity form) with filtered  data based on selected activity number. In order to achieve this just override "jumpref" method at the datasource field level comment call to super. Instead add following code and the job is done.

public void jumpRef()
{
    //super();
    FormRun formRun;
    Args args = new Args();
    ;
    args.name(formstr(smmActivities));
    args.record(smmActivities::find(projForecastEmpl.ActivityNumber));
    formRun = ClassFactory.formRunClass(args);
    formRun.init();
    formRun.run();
    formRun.wait();
}

Logic can be changed as per user need and the respective form can be opened.

Enjoy !!!!!!!!!!!!!!!!

1 comment:

  1. Thankyou!!!!! here's my adaptation:
    public void jumpRef()
    {
    //super();
    FormRun formRun;
    Args args = new Args();
    ;
    args.name(formstr(InventNonConformanceTable));
    args.record(InventNonConformanceTable::find(InventNonConformanceTable.InventNonConformanceId));
    formRun = ClassFactory.formRunClass(args);
    formRun.init();
    formRun.run();
    formRun.wait();
    }

    ReplyDelete