# Data method acting like datasource field

**URL:** <https://www.dynamicsuser.net/t/data-method-acting-like-datasource-field/48501>\
**Category:** Technical Forum\
**Created:** [October 1, 2013, 2:21am UTC](https://www.dynamicsuser.net/t/data-method-acting-like-datasource-field/48501 "2013-10-01T02:21:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![DominicB](https://avatars.discourse-cdn.com/v4/letter/d/e56c9b/32.png) [@DominicB](https://www.dynamicsuser.net/u/DominicB)\
**Post date:** [October 1, 2013, 2:21am UTC](https://www.dynamicsuser.net/t/data-method-acting-like-datasource-field/48501/1 "2013-10-01T02:21:46Z")

</div>

Would it be possible to make a code change to allow old version of Axapta making **data method** acting on a grid like **datasource field** :[**Modifiable** , **sorting** , **filtering**]. Or this part of code is restricted from developers to change it?

---

<div class="post-metadata">

**Author:** ![MartinDrab](https://avatars.discourse-cdn.com/v4/letter/m/e0b2c6/32.png) [@MartinDrab](https://www.dynamicsuser.net/u/MartinDrab)\
**Post date:** [October 1, 2013, 9:19am UTC](https://www.dynamicsuser.net/t/data-method-acting-like-datasource-field/48501/2 "2013-10-01T09:19:16Z")

</div>

You can overwrite control’s _sort()_ method and implement some sorting there, but it still needs to be based on some database fields - you obviously can’t write a DB query that would use results of your X++ method. I don’t think there is such a straightforward workaround for filtering - maybe you could set the value to a field with SaveContents = No and overwrite control’s _filter()_, but then it’s probably better to save the calculated value to database.

About modifications, you can use _edit_ methods.

Nevertheless if you need something that works exactly as a field, use a field.

---

<div class="post-metadata">

**Author:** ![DominicB](https://avatars.discourse-cdn.com/v4/letter/d/e56c9b/32.png) [@DominicB](https://www.dynamicsuser.net/u/DominicB)\
**Post date:** [October 1, 2013, 1:34pm UTC](https://www.dynamicsuser.net/t/data-method-acting-like-datasource-field/48501/3 "2013-10-01T13:34:02Z")

</div>

The edit method should be use like the display method?

Could you give me a quick sample?

---

<div class="post-metadata">

**Author:** ![MartinDrab](https://avatars.discourse-cdn.com/v4/letter/m/e0b2c6/32.png) [@MartinDrab](https://www.dynamicsuser.net/u/MartinDrab)\
**Post date:** [October 1, 2013, 1:47pm UTC](https://www.dynamicsuser.net/t/data-method-acting-like-datasource-field/48501/4 "2013-10-01T13:47:04Z")

</div>

[This link](http://lmgtfy.com/?q=dynamics+ax+edit+method) should help. [:)]
