How to Lock the grid filter for Reference Field

Hi everyone,

Version : Ax2012 R2

Problem: I want to disable the Grid Filter for the Reference Group Field using the form Grid. How can I achieve this.

CTRL+G will allow to use the grid Filter, I want to Lock the filter range of Reference Group field which is used in the grid.

Thanks

Hi,

In AX 2009, i used the following code on formdatasource ExecuteQuery() method :

this.query().dataSourceNo(1).Addrange(Fieldnum(YourTable,YourField)).value(yourRange);

this.query().dataSourceNo(1).addRange(fieldnum(YourTable,yourField)).status(rangestatus::Locked);

it locks the range on the value YourRange

this should work in AX 2012

Hope it helps

Regards,

Thomas

Thanks for the response.

It will work only for Normal field , not for Reference Group Fields, I have already tried this solution but it is not working.

Thanks