Open GoogleCodeExporter opened 8 years ago
The ESAPI Library currently doesn't support inserting related objects. My
recommendation for this scenario will be to validate access permission by using
the isAuthorizedTo* methods before doing a regular DML operation.
For example:
boolean obj1 =
ESAPI.accessController().isAuthorizedToCreate(Obj1__c.getSObjectType(), new
List<String>{'field1__c','field2__c'});
boolean obj2 =
ESAPI.accessController().isAuthorizedToCreate(Obj2__c.getSObjectType(), new
List<String>{'field1__c','obj1__c'}); //Notice the lookup object to obj1 here
if (obj1 && obj2){
obj1 o1 = new obj1(....);
obj2 o2 = new obj2();
o2.obj1__r = o1;
insert o1;
insert o2;
}else{
//handle error here
}
Original comment by jonathan...@gmail.com
on 5 May 2014 at 4:22
Original issue reported on code.google.com by
vanessen...@sc-mauritius.com
on 11 Mar 2014 at 9:58