You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Crud show correctly the recordset but when I try to edit a row, changing tipo value, I get this error on saving:
Critical Error
Atk4\Data\Exception: Record with specified ID was not found
model: Modello
id: 3311
scope: 'expression 'tipo = '+'''
action: Atk4\Data\Model\UserAction (edit)
The text was updated successfully, but these errors were encountered:
nocelab
changed the title
Crud with AddCondition()
CRUD with AddCondition()
Apr 18, 2024
You need to make sure that onSubmit the model is unconditioned that is used to save the changed entity, and the conditioned model is only used to display the crud.
Agree that this it not very intuitive and good tips welcome what the best way to code it might look like
Thanks... very happy that someone has a similar situation!!!
I need to deep read the post to understand better if there is my answer... but it's sure the right way.
I need to set a Crud with a records subset.
The Model has the combo field:
$this->addField('tipo', ['values' => ['x' => 'fix', '+' => 'new', '-' => 'removed']]);
and I add condition with:
$mod->addCondition($mod->expr("tipo = '+'"));
Crud show correctly the recordset but when I try to edit a row, changing
tipo
value, I get this error on saving:The text was updated successfully, but these errors were encountered: