Hi everybody,
in order to test a flow that runs on Contract, I'll be doing a calculation involving records of a custom object blng__UsageSummary__c
What I want to do is update all the records that we have in a sandbox so that records of this object have a value in their blng__Subtotal__c fields. It can just be 1 that's fine.
My code in Execute Anonymous is this:
List <blng__UsageSummary__c> allUsageSummaries = [SELECT Id, blng__Subtotal__c FROM blng__UsageSummary__c WHERE Id = aL19M00000000OESAY];
for (blng__UsageSummary__c loopUs : allUsageSummaries) {
loopUs.blng__Subtotal__c = loopUS.blng__Subtotal__c = 1;
}
upsert allUsageSummaries;
Just in case anything goes wrong, I've limited the query to one specific record so that the loop will only iterate for one record and only one record will be upserted. I'm getting an error at the first < character and I can't see why. Just wondering if anyone can point me in the right direction.
I know I could use Data Loader for this but I'm just seeing if I can do this using Apex as I'm trying to develop my knowledge of it.
Thanks.
Matt
Everything seems fine the only problem is to write the ID in single quotes and it will work.
Like WHERE Id = 'aL19M00000000OESAY'
Thanks!