Quantcast
Channel: AX Developer Forum
Viewing all articles
Browse latest Browse all 9880

Error: Cannot edit a record in my table

$
0
0

Hi All,

I am just trying to update the total quantity in the header section when i update the quantity in the grid.

So, i used this method, In the grid quantity field modified, sum the total quantity for the header and update the quantity in the header total quantity. So, when i close the form and doing some other action. I am getting the below error.

Please can you explain me, what mistake i did.

"Cannot edit a record in MyTable (MyTable).

The values displayed in the form are not current, so an update or deletion cannot be made. To view the current values, on the Command menu, click Restore or press CTRL+F5."

My Code:

public void modified()

{

    LineTable lineTable;

    real ItemQty;

    int TotalNoOfBags;

    super();

 

    lineTable = LineTable_ds.getFirst();

    ItemQty = 0;

    TotalNoOfBags = 0;

    while (lineTable)

    {

        ItemQty += lineTable.ItemQty;

        TotalNoOfBags += lineTable.NumberOfBags;

        lineTable = LineTable_ds.getNext();

    }

 

    HeaderTable.TotalNoOfBags = TotalNoOfBags;

    HeaderTable.TotalQty = ItemQty;    

    HeaderTable.update();

}

 

Thanks in advance,

Hari


Viewing all articles
Browse latest Browse all 9880

Trending Articles