Unified Operations & Dynamics AX Forum

Expand all | Collapse all

Cannot edit a record in tableName (tableName). The record has never been selected.

  • 1.  Cannot edit a record in tableName (tableName). The record has never been selected.

    TOP CONTRIBUTOR
    Posted 15 days ago
    Edited by Rudy Salcedo 15 days ago
    ​Our users sometimes get this error on one of our customized inquiry forms:

    Cannot edit a record error msg
    My understanding is that this error msg is issued when trying to update a record that hasn't been read/selected.

    I wanted to put the form in debug so I could determine the call stack leading up to the error.  I overrode the table's insert() and update() methods, but I only see the super() statement in both methods.  If I put a breakpoint on the super() statement, I don't see any other method calls in the call stack.

    Call stack
    In order to see the entire call stack leading up to the error msg, where would I put the breakpoint(s)?


    ------------------------------
    Rudy Salcedo
    Senior Programmer/Analyst
    LaForce, Inc
    Green Bay WI
    ------------------------------


  • 2.  RE: Cannot edit a record in tableName (tableName). The record has never been selected.

    TOP CONTRIBUTOR
    Posted 13 days ago
    ​Your not getting a debug point that way because it errors before it can do the action.

    A more efficient method would probably to use the used by cross reference (assuming you've done a full compile with cross reference turned on). From those results, you'll probably recognize the form/class that is in the code path of the issue and jump to the code from there.

    What your looking for is an insert or update call to the table where the source of the row (the select) is not issuing the forupdate keyword. Alternatively, some coders set the forUpdate property after the select, once they know they need to perform an update. This can go wrong if the property setting occurs in a conditional block that never occurs, even when the update does. If it only occurs sometimes, this may be the more likely situation.


    ------------------------------
    Tony Zeigler
    Senior Consultant
    Strategic Solutions NW, LLC
    Beaverton OR
    ------------------------------



  • 3.  RE: Cannot edit a record in tableName (tableName). The record has never been selected.

    TOP CONTRIBUTOR
    Posted 11 days ago
    @Tony Zeigler thanks for the info and advice.  I'll update the cross reference and try what you suggested.  Thanks!​

    ------------------------------
    Rudy Salcedo
    Senior Programmer/Analyst
    LaForce, Inc
    Green Bay WI
    ------------------------------



If you've found this thread useful, dive deeper into User Group community content by role