Triggering Update Event¶
To trigger an event, update an existing Order
object in the Backendless database. This can be done with any Backendless SDK (Android, iOS, JS, .NET), REST API or Backendless Console:
Map orderObject = // retrieve an existing object
// update a property in the object
orderObject['orderAmount'] = 1200;
// now save the updated object
Backendless.data.of("Order").save(orderObject).then((updatedOrder) {
print("Order Object has been updated in the database - ${updatedOrder['objectId']}");
});
import 'package:backendless_sdk/backendless_sdk.dart';
@reflector
class Order {
int orderAmount;
String orderName;
String objectId;
}
Order order = // retrieve an order from the database
// update an order property
order.orderAmount = 2150;
// save the object in the database
Backendless.data.withClass<Order>().save(order).then((updatedOrder) {
print("Order Object has been updated in the database - ${updatedOrder.objectId}");
});