Data is not saving from ui from add new button

Questions

QuestionsCategory: Magento 2 QuestionsData is not saving from ui from add new button
Abdus Salam asked 6 years ago

Data is not saving in the table when submitting from UI form in Magento 2 but Magento doesn’t give an error, but data is saving while editing the form.

0 Answers
Qaisar Satti Staff answered 6 years ago

hi abdul salam,

this error probably due the primary key hidden field. check if the primary key value is not set then unset the primary key data.

  $primaryKey = $data['primary_id'];

   if(empty($primaryKey)):
     unset($data['primary_id']);
   endif;

Reason: when the primary key is set model try to update the record in table.

© Copyrights 2025. All rights reserved.