The standard FormTreeDatasource doesn't implement
filtered datasource into it. If you want to implement,
modify subTreeQueryRun function in FormTreeDataSource
class. Call mergeRanges method to merge the ranges
into a new query object:
QueryRun subTreeQueryRun(AnyType _ParentValue)
{
Query query = new Query();
QueryBuildDataSource queryBuildDataSource =
query.addDataSource(formDataSource.table());
QueryBuildRange criteriaParentId =
queryBuildDataSource.addRange(parentId);
;
queryBuildDataSource.addSortField(txt);
SysQuery::mergeRanges(query,formDataSource.query());
//this is the additional code
if (_ParentValue)
criteriaParentId.value(_ParentValue);
else
criteriaParentId.value(strFmt('"%1"',queryValue(_ParentValue)));
return new QueryRun(query);
}
This is to filter the CustTable datasource, init
method on tutorial_Form_Treedatasource form:
void init()
{
super();
SysQuery::findOrCreateRange(
CustTable_q.dataSourceNo(1),
fieldNum(CustTable,CustGroup)).value(queryValue('20'));
treeDatasource = new
FormTreeDatasource(this,element.control(control::Tree),
fieldnum(CustTable,accountNum),
fieldnum(CustTable,invoiceAccount),
fieldnum(CustTable,name)
);
treeDatasource.initRoot(CompanyInfo::find().name,'');
}
If there are another requirements, then modify the
class if needed.
Good luck.
Best regards,
Sonny Wibawa Adi, MBSCP, MCSD.NET, MCAD.NET
--- Andre Klopper <[EMAIL PROTECTED]>
wrote:
>
> Ok,
>
> So I worked through the
> tutorial_Form_TreeDatasource. I get this to work but
> would like to take it one step futher... I want do
> create the tree on the
> data in a filtered datasource. How do I assign the
> filtered datasource to
> the FormTreeDatasource?
>
> Regards
> Andre
>
>
>
>
>
__________________________________
Yahoo! Mail for Mobile
Take Yahoo! Mail with you! Check email on your mobile phone.
http://mobile.yahoo.com/learn/mail
SPONSORED LINKS
Computer part | Programming languages | Microsoft axapta |
Support exchange |
YAHOO! GROUPS LINKS
- Visit your group "development-axapta" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.