Wednesday, October 7, 2009

Using value from methods for Filters



A neat (new?) AX functionality is to be able to use dynamic code to filter forms. For example, you can use a piece of code that returns a user’s current department and use it for your filter.




A few things must be done.


1. You can only use methods that are in SysQueryRangeUtil class (you can create your own in this class)


2. The method must be set to public static


3. When referencing the method in the filter screen, wrap it in parenthesis



A good example on how this is used is the query called smmContacts_MyContacts where the MainResponsible range value is ((Mainresponsible == currentEmployeeId()) && (Mainresponsible != ""))



Enjoy!

No comments:

Post a Comment