Modifying the datasource on a form

alberto_alvarado
Member Posts: 6
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.
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.
0
Comments
-
i think this article can help you on your query
http://insidedynamicsax.blogspot.com/2007/09/form-visual-designer-and-report-visual.htmlrajajang0 -
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.J0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions