Delete a record in mobile

  • 1
  • Question
  • Updated 4 years ago
  • Answered
When designing a mobile interface using the mobile composer, how do you create a 'Delete' record button?
Photo of Gregg Baxter

Gregg Baxter, Official Rep

  • 3,080 Points 3k badge 2x thumb
  • stumped

Posted 4 years ago

  • 1
Photo of Zach McElrath

Zach McElrath, Employee

  • 49,056 Points 20k badge 2x thumb
Currently this requires a JavaScript Snippet like this:

var params = arguments[0],
    model = params.model,
    row = params.item ? params.item.row : params.row;
if (model && row) {
    model.deleteRow(row);
    model.save();
} else {
    console.error('could not find a model or row');
}

We're working on releasing an action to do this natively in the Action Framework.
(Edited)