Skip to main content

Notifications

Advance filter Dynamics Ax 2012 Similar to Like wildcard functionality

Today during development of inquiry form, I had chance to explore filters in little more depth.

For example if you have to add functionality similar to wildcard like operator.

 

“Select * from customer where Customer.Name is like ‘%Ali%’

You have to use static functions  SysQuery::valueLike and SysQuery::ValueLikeAfter. For example If I had customer table as data source then I create a new filter inside ExecuteQuery method

 

 

 

QueryBuildRange customerFilter;

customerFilter  =SysQuery::findOrCreateRange(PGDFileline_q.dataSourceTable(tablenum(custtable)),fieldNum(Custtable,AccountNum));

 

if (custTxt.text()=="")

{

customerFilter .value(SysQuery::valueUnlimited());

}

else

{

customerFilter.value(SysQuery::valueLikeAfter(custTxt.text()));

}

super();

}

 

 

 

Similar posts are

 

 

http://tech.alirazazaidi.com/how-to-create-a-custom-filter-on-list-or-inquiry-form-in-dynamics-ax-2012/

 

 

http://tech.alirazazaidi.com/date-in-advance-filter-dynamics-ax-2012/

Comments

*This post is locked for comments