You need to sign in to do that
Don't have an account?
D0T
Default value for a field type check box not working
I've just deployed the Birthday reminder code and modified it based on our needs. I've tested the APEX code and everything works fine - however we have 9000 clients and would like the default value for the checkbox to be "checked". I've editted the custom field, however the value on the client page still remains unchecked, am I doing something wrong?
Thanks
A.Y
I think some records are failing due to data validation, update method behaviour is all or none so if any record is failing validation it will stop all. SO you need to use DataBase.update it will let valid records to be updated.
All Answers
Is this happening with new records as well or only with existing records
I didnt check new, but existing not being updated.
New cleints - works fine.
Thats what I wanted to know , solution is you need to run a script for old clients where you have to update this field value. You can update them using dataloader as well.
How can I do it with Data loader or a Script?
Thanks,
A.Y
Run this is debug log , Use API Name with name space
Thank you,
Object is contact and API name is Send_Birthday_Email__c, I tried replaceing it but getting an error - Error on column 1
use this
If you have name space then change this
obj.Send_Birthday_Email__c = true;
to
obj.NameSpaceName__Send_Birthday_Email__c = true;
Still getting this error.
Error: Compile Error: unexpected token: 'List.' at line 1 column 0
are you copying it to system logs and executing it.
Log Status : Too Many DML ROW 1001
any idea?
You need to run this for 1000 records in one time
As you were saying you have 9000 records , so you need to run it 9 times.
Sorry for the delayed response - I'm getting the following error when excuting the code.
[URL=http://imageshack.us/photo/my-images/571/errorlog.jpg/][IMG]http://img571.imageshack.us/img571/6526/errorlog.th.jpg[/IMG][/URL]
http://imageshack.us/photo/my-images/571/errorlog.jpg/
I think some records are failing due to data validation, update method behaviour is all or none so if any record is failing validation it will stop all. SO you need to use DataBase.update it will let valid records to be updated.
This appears to be working. I will report back if there are any hiccups. As of now so far so good.
Thank you for your help.
A.Y
Surely you can always ask but I would request you to mark it as Accepted Solution so that others could also get benifitted from it.