Modifying the datasource on a form

alberto_alvaradoalberto_alvarado Member Posts: 6
edited 2008-01-17 in Dynamics AX
Hi everyone, I'm new to Axapta, and I need to modify a form. I need the form ProjSalesPriceHour to filter the records shown. As I understand, I have to modify the init() method, from the datasource of the form.

The query I want to use is:

SELECT *
FROM PROJHOURSALESPRICE PHS, PROJTABLE P
WHERE P.PROJID = PHS.PROJID AND P.GERENTECUENTA = '562'

GERENTECUENTA is the value of the employee ID of a manager asigned to a
project. I´m trying to compare the value stored in the ProjTable with the
value of the Employee ID of the user currently in session.

How should I write my query using the Query, QueryBuildDataSource and
QueryRange form?

Where can I get the API to learn this myself, or a good tutorial? Thanks a
lot again. I´d appreciate a lot your help.

Comments

  • rajajangrajajang Member Posts: 2
    rajajang
  • Vinoth_mct2003Vinoth_mct2003 Member Posts: 26
    first you have to define query, query buil data source..

    see the eg below

    static void SelectCustomerQuery(Args _args)
    {
    Query query;
    QueryBuildDataSource queryBuildDatasource;
    QueryBuildRange queryBuildRange;
    QueryRun queryRun;
    Counter recordsFound;
    ;
    query = new Query();
    queryBuildDataSource =
    query.addDataSource(tableNum(CustTable));
    queryBuildDataSource.addSortField(fieldNum(CustTable,
    Name));
    queryBuildRange =
    queryBuildDataSource.addRange(fieldNum(CustTable,
    Country));
    queryRun = new QueryRun(query);
    With Regards,
    Vinoth Kumar.J
Sign In or Register to comment.