Skip to content

Triggering Delete Event

To trigger an event, delete an Order object from the Backendless database. This can be done with any Backendless SDK (Android, iOS, JS, .NET), REST API or Backendless Console:

HashMap<String, Object> orderObject = // retrieve an existing object

// now delete the object
Backendless.Data.of( "Order" ).remove( orderObject, new AsyncCallback<Long>()
{
  @Override
  public void handleResponse( Long timestamp )
  {
    Log.i( "MYAPP", "Object has been deleted from the database" );
  }

  @Override
  public void handleFault( BackendlessFault fault )
  {
    Log.e( "Server reported an error " + fault.getDetail() );
  }
} );

Order class:

package com.company;

public class Order
{
  public String objectId;
  public String orderName;
  public Double orderAmount;
}
Deleting an instance of Order from the database:
Order order = // retrieve an order from the database

// delete the object from the database
Backendless.Data.of( Order.class ).remove( order, new AsyncCallback<Long>()
{
  @Override
  public void handleResponse( Long timestamp )
  {
    Log.i( "MYAPP", "Order object has been deleted from the database" );
  }

  @Override
  public void handleFault( BackendlessFault fault )
  {
    Log.e( "Server reported an error - " + fault.getDetail() );
  }
} );