function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Synthia B.Synthia B. 

Update Opportunities Simultaneously

I created two check boxes Yes and No on a custom object.
The default value for No is checked.
I would like to implement this for all active opportunities.
How can I accomplish this simultaneously?  
Best Answer chosen by Synthia B.
Neetu_BansalNeetu_Bansal
Hi Synthia,

You need to run a script, to update all the values of your custom object. Let's suppose if your object name is Test__c and field name is No__c. Use this code and run on developer console:
List<Test__c> test = [ Select Id, No__c from Test__c where No__c = false ];
for( Test__c t : test )
{
	t.No__c = true;
}

if( test.size() > 0 )
	update test;
Let me know if you need any other help.

Thanks,
Neetu

All Answers

Neetu_BansalNeetu_Bansal
Hi Synthia,

You need to run a script, to update all the values of your custom object. Let's suppose if your object name is Test__c and field name is No__c. Use this code and run on developer console:
List<Test__c> test = [ Select Id, No__c from Test__c where No__c = false ];
for( Test__c t : test )
{
	t.No__c = true;
}

if( test.size() > 0 )
	update test;
Let me know if you need any other help.

Thanks,
Neetu
This was selected as the best answer
Synthia B.Synthia B.
Thank you Neetu. I will give that a try and let you  know how it goes.