Hello @Khalid9030 ,

 

current.insert() should be inserted only inside if loop where you will check if given record isNewRecord() else current.update() should run.

 

For Example

if(current.isNewRecord()){ //New Record which is not saved/created/inserted into the table yet.
current.insert();
}else{
current.update();
}

Let me know if it helps.

 

Thanks,

Shubham

View solution in original post