How to add user range in DataSource in ax 2012

In this article we will see about how to add user range in DataSource, so if multiple user open same form at that time data will be see multiple time if there are no any filter occurs, here I have given login user range in DataSource so when any user open same form same time and filter data it could be different or same. Data will be display for that user only.

First declare QueryBuildRange object in Form.
QueryBuildRange             Userrage;

After add range in dataSource init method after super method.

super();
Userrage = this.query().dataSourceNo(1).addRange(fieldNum(Tablename,createdBy));

After Give user id in Range value in DataSource execute Query.

public void executeQuery()
{
    //User range
    Userrage.value(curUserId());
    super();
}

Related Posts

Previous
Next Post »

1 comments:

comments

Thanks for comments.....