Update operation on BO fails
Summary
Update operation on BO failsContent
Hey,
I'm trying to perform an update operation on the data of a Business Object. But it fails.
Can anyone please help with this?
require([
'operation/js/api/Conditions',
'operation/js/api/Operator'
], function(Conditions, Operator) {
var so = Abcs.Entities().findById('SearchAccount');
var SendFlag = so.getProperty('sendToEloqua');
//var condition = Conditions.SIMPLE(SendFlag, Operator.EQUALS,'Y');
var operation = Abcs.Operations().update({
entity: so,
record: {
sendToEloqua: 'N'
}
});
operation.perform().then(function(operationResult) {
if (operationResult.isSuccess()) {
alert("Updating Contact");
operationResult.getData().forEach(function(oneRecord) {
resolve("ok");
});
}
}).
catch(function(operationResult) {
if (operationResult.isFailure()) {
// Insert code you want to perform if fetching of records failed