How to assign filtered record field values to form Control.

satish_nav
Member Posts: 65
I am new to Axapta\X++
When i select a EmpNo from lookup refers EMPTable, other details from the emp record(name. designation,etc..) have to fill in other controls in my from.
This have to happen in the EMPNo onvalidate().
for this i have filtered EMPtable as below, but iam struggling to assign the filed values from filtered record to form controls.
Error: I am gettign syntax error, where i underlined in the code.
public boolean validate()
{
boolean ret;
str TestName;
EmpTable ETable;
Query query = new Query();
QueryBuildDataSource queryBuildDataSource;
QueryBuildRange queryBuildRange;
QueryRun queryRun;
;
queryBuildDataSource = query.addDataSource(tableNum(EmpTable));
queryBuildRange = queryBuildDataSource.addRange(fieldNum(EmpTable,EmpNo));
queryBuildRange.value(EmpNo.text());
queryRun = new QueryRun(query);
while(queryRun.prompt())
{
Queryrun.get(tableNum(EmpTable));
TestName = EmpTable.EmpName;
}
ret = super();
return ret;
}
Can any one help me..how to do this..
When i select a EmpNo from lookup refers EMPTable, other details from the emp record(name. designation,etc..) have to fill in other controls in my from.
This have to happen in the EMPNo onvalidate().
for this i have filtered EMPtable as below, but iam struggling to assign the filed values from filtered record to form controls.
Error: I am gettign syntax error, where i underlined in the code.
public boolean validate()
{
boolean ret;
str TestName;
EmpTable ETable;
Query query = new Query();
QueryBuildDataSource queryBuildDataSource;
QueryBuildRange queryBuildRange;
QueryRun queryRun;
;
queryBuildDataSource = query.addDataSource(tableNum(EmpTable));
queryBuildRange = queryBuildDataSource.addRange(fieldNum(EmpTable,EmpNo));
queryBuildRange.value(EmpNo.text());
queryRun = new QueryRun(query);
while(queryRun.prompt())
{
Queryrun.get(tableNum(EmpTable));
TestName = EmpTable.EmpName;
}
ret = super();
return ret;
}
Can any one help me..how to do this..
Thanks in advance..
Satish...
Satish...
0
Comments
-
I got solution my self(with my frnd) for this issue.
i used below peace of code:
select EmpName from et where et.EmpNo == _EmpNo.text();
Ename.text(et.EmpName);
here _EmpNo.text() is the droupdown control in the my form
Ename.text() is the text box name, where i print the selected empname in my form.
we can write this code either droupdown textbox onvalidate() or put cmd button and write this on push();Thanks in advance..
Satish...0
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