mardi 14 décembre 2010

How to filter records in a form from X++

Some time you need to show filtered records on the form (adding ranges to form datasource).  you just need write some code similar to this :

this.query().dataSourceName("CustTable").addRange             (fieldnum(CustTable,Currency)).value(queryvalue(‘USD’)); 

Follow this Link : 

http://dynamics-ax-live.blogspot.com/2010/03/how-to-filter-records-in-form-by-code.html 

Some time you need to use expressions or if you need OR clause in the query. Support of expressions is very good to implement the complex queries containing some complex joins and conditions. if you need to implement OR clause then again you need to use the expressions. If you add ranges to two different fields then it default supports the “And &&” clause, the “OR ||” clause is only supported if you add ranges to same field with different value. In all other cases we need to use the expressions to implement the OR clause. For details on implementing the expressions

See this Link : 
 http://www.axaptapedia.com/Expressions_in_query_ranges

Happy Daxing !

Aucun commentaire:

Enregistrer un commentaire