Mark Delete Row using Snippet

  • 1
  • Question
  • Updated 8 months ago
  • Answered
I am using following block of code to mark rows in model for deletion.
if(delQliPri.data.length >0){
    $.each(delQliPri.data,function(i,row){
    console.log('RowID------>',row.Id);
    delQliPri.deleteRow({Id:row.Id});
    });
}
but it is doing nothing. Don't understand where it is wrong. Help me in understanding it. I tried to implement it from this Skuid document
Photo of Dinesh Ramanadham

Dinesh Ramanadham

  • 372 Points 250 badge 2x thumb
  • undecided

Posted 9 months ago

  • 1
Photo of Stephen Sells

Stephen Sells, Official Rep

  • 16,856 Points 10k badge 2x thumb
I see deleteRow() but I don't see abandonAllRows()
Photo of Dinesh Ramanadham

Dinesh Ramanadham

  • 372 Points 250 badge 2x thumb
Yes, I want to mark row for deletion. So on save of the model row will be deleted from Salesforce database. I believe abandonAllRows() is to remove data from model, that won't delete any data from Salesforce database.
(Edited)
Photo of Peter Hale

Peter Hale, Employee

  • 330 Points 250 badge 2x thumb
Are you trying to delete all of the rows in the  model?  If so, instead of delQliPri.data, use delQliPri.getAllRows() in the each statement.  Also, call deleteRow(row), instead of {Id:row.Id}
Photo of Dinesh Ramanadham

Dinesh Ramanadham

  • 372 Points 250 badge 2x thumb
Thank you Peter, this helped me.