You need to sign in to do that
Don't have an account?
Daniel K
logic to update object fields
Hi All,
I have two objects from where I have to compare Id field and update few fields on one of the objects.
Let's say..
select field1 from object1 where condition=true --> here i have 100k records
select field2 from object2 where condition = true --> here I have 90k records
Here, if field1=field2 then I have to update object1.field3='abc' ,object1.field4='xyz' and so on
I think I can do this just by using List and Loop(haven't really tried though), but how to skip the governor limits of updating more than 50k records ?
Please guide in solving this.
Thanks.
I have two objects from where I have to compare Id field and update few fields on one of the objects.
Let's say..
select field1 from object1 where condition=true --> here i have 100k records
select field2 from object2 where condition = true --> here I have 90k records
Here, if field1=field2 then I have to update object1.field3='abc' ,object1.field4='xyz' and so on
I think I can do this just by using List and Loop(haven't really tried though), but how to skip the governor limits of updating more than 50k records ?
Please guide in solving this.
Thanks.
I hope Batch Apex will be able to tackle this issue.
1) If you have large dataset and that needs to be executed once then you can go for a batch apex and execute it once.
2) If you have large dataset and that is getting created on daily basis then you can go for daily scheduled batch apex.
Please let me know if this helped and mark as a best answer.
Regards,
Ramakant
Regards,
Ramakant