You need to sign in to do that
Don't have an account?

Simple update set of records
In Apex/Eclipse, how can I perform this simple update:
UPDATE bookings SET field1 = 'a', field2 = 'b', field3 = 'c' WHERE set_id = 999
So all I want to do is update all the records with the set_id that I specify. bookings would be my custom object.
Cheers
UPDATE bookings SET field1 = 'a', field2 = 'b', field3 = 'c' WHERE set_id = 999
So all I want to do is update all the records with the set_id that I specify. bookings would be my custom object.
Cheers
List<bookings__c> bookings = [select set_id__c, field1__c, field2__c, field__c from bookings__c where set_id__c = '999'];
if(!bookings.isEmpty()){
for(bookings__c booking :bookings){
booking.field1__c = 'a';
booking.field2__c = 'b';
booking.field3__c = 'c';
}
update bookings;
}
select fields from bookings__c where set_id__c = '999' AND Id != :currentId
So it should not select the record that is currenrtly being updated, but it's producing unexpected errors. Will post more on that when I try again this morning.
Any ideas?