Record with RecId xxx in table ‘ProdTableProj’ has mismatching Sequence field values. Original value was xxx, new value is xxx.

While trying to save a change to a record in the ProdTable form, users were rewarded this message instead: 

Record with RecId xxx in table ‘Produktionsaufträge’ has mismatching Sequence field values. Original value was xxx, new value is xxx.

Ein Datensatz in Produktionsaufträge (ProdTableProj) kann nicht bearbeitet werden.

Die Datensatznummer entspricht nicht der ursprünglichen Nummer. Wenn die Tabelle den gesamten Tabellencache verwendet, liegt die Ursache möglicherweise darin, dass der Cache geleert wurde. Starten Sie den Einzelvorgang erneut, wenn dies der Fall ist.

 The change was actually saved, but they had to undo the change to be able to close the form.  Digging into the issue, I found that it was trying to insert a record into ProdTableProj which already existed.  It was trying to do this because prodTableProjOver in ProdTableForm was not being set properly.  To fix this, change “prodTableProjOver = datasources3;” to “prodTableProjOver = datasources4;“:

public void setDatasources(Common datasources1, Common datasources2 = null, Common datasources3 = null, Common datasources4 = null, Common datasources5 = null)
{
    ;
    prodTable = datasources1;
    inventDim = datasources2;
    prodTableProjError = datasources3;
    prodTableProjOver = datasources4;
    prodTable_ds = prodTable.dataSource();
    inventDim_ds = inventDim.dataSource();
    prodTableProjError_ds = prodTableProjError.dataSource();
    prodTableProjOver_ds = prodTableProjOver.dataSource();

    if (!prodTable_ds &&
        !inventDim_ds)
    {
        checkFailed(strfmt(“@SYS117974”, classId2Name(classidget(this))));
    }
}

Advertisements