# AX2012 traversing and updating grid value

**URL:** <https://www.dynamicsuser.net/t/ax2012-traversing-and-updating-grid-value/55441>\
**Category:** Developer Forum\
**Created:** [October 22, 2014, 7:45am UTC](https://www.dynamicsuser.net/t/ax2012-traversing-and-updating-grid-value/55441 "2014-10-22T07:45:09Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![donnls357](https://avatars.discourse-cdn.com/v4/letter/d/90db22/32.png) [@donnls357](https://www.dynamicsuser.net/u/donnls357)\
**Post date:** [October 22, 2014, 7:45am UTC](https://www.dynamicsuser.net/t/ax2012-traversing-and-updating-grid-value/55441/1 "2014-10-22T07:45:09Z")

</div>

hi i have a current project that has the following scenario:

- there is a form that has a header and grid.

- at the header, i should input a value. this value should then be the value of a certain field in the grid.

lets say for example,

there is a field in the header named withholding percentage. then there is a grid that contains the records from the custTable.

whatever value that will be inputted in the header field which is withholding percentage, should be the value of of the ‘withlolding percentage’ field of ALL the records in the grid.

can anybody help me with this code.

---

<div class="post-metadata">

**Author:** ![krishna.rao](https://avatars.discourse-cdn.com/v4/letter/k/ac8455/32.png) [@krishna.rao](https://www.dynamicsuser.net/u/krishna.rao)\
**Post date:** [October 22, 2014, 8:24am UTC](https://www.dynamicsuser.net/t/ax2012-traversing-and-updating-grid-value/55441/2 "2014-10-22T08:24:09Z")

</div>

you have to write code for updation in the grid based on the criteria.

eg;

update\_recordset tableA

Setting field1 = 20%

where tableA.Field1 == …

---

<div class="post-metadata">

**Author:** ![donnls357](https://avatars.discourse-cdn.com/v4/letter/d/90db22/32.png) [@donnls357](https://www.dynamicsuser.net/u/donnls357)\
**Post date:** [October 22, 2014, 8:50am UTC](https://www.dynamicsuser.net/t/ax2012-traversing-and-updating-grid-value/55441/3 "2014-10-22T08:50:02Z")

</div>

note sir that the record should not be saved yet to the database.

---

<div class="post-metadata">

**Author:** ![krishna.rao](https://avatars.discourse-cdn.com/v4/letter/k/ac8455/32.png) [@krishna.rao](https://www.dynamicsuser.net/u/krishna.rao)\
**Post date:** [October 22, 2014, 11:23am UTC](https://www.dynamicsuser.net/t/ax2012-traversing-and-updating-grid-value/55441/4 "2014-10-22T11:23:29Z")

</div>

then u should be more specific…

else

no one will fix your issue

---

<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 22, 2014, 6:06pm UTC](https://www.dynamicsuser.net/t/ax2012-traversing-and-updating-grid-value/55441/5 "2014-10-22T18:06:09Z")

</div>

If you just want to display the value, create a [display method](http://msdn.microsoft.com/en-us/library/aa595058.aspx) (or an edit method, if the value may be eventually set). It can simply return the value of the active header record (without any query to database).
