You need to sign in to do that
Don't have an account?
Critter
Can set checkbox to false, but not true
I have this bit of code:
Project_Task__c autoTask = [Select id,auto_schedule__c from Project_Task__c where id = :theTask.id]; System.debug('This is the NEW **bleep** auto Task: ' +autoTask.auto_schedule__c); autoTask.Auto_Schedule__c = false; autoTask.Name = 'Blah blah'; update autoTask;
and all is well...
Should I attempt to set the 'Auto_Schedule__c' to true, I get an error..
10:38:39.528 (1528085000)|CODE_UNIT_FINISHED|ProjectTaskRipple on Project_Task trigger event AfterUpdate for [a0BR0000006DgHW] 10:38:39.530 (1530642000)|DML_END|[40] 10:38:39.530 (1530733000)|EXCEPTION_THROWN|[40]|System.DmlException: Update failed. First exception on row 0 with id a0BR0000006DgHWMA0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, ProjectTaskRipple: execution of AfterUpdate caused by: System.NullPointerException: Attempt to de-reference a null object
any suggestions? I cannot suss why I am getting this error..
Do you have the right permissions and sharing set up for the person running the transaction? It looks like your getting an error in access to the object and then returning a null reference.
--KC
I've never had a problem before. This is being run in a test case. AND... I can set it to true when I create the object..
This works...
This won't...
I tried that bit of your code and it worked fine for me, could you post the whole code so I can see the whole context that's running?
--KC
here is all of it so far...
From the debug log you have posted, the problem is in the after update trigger ProjectTaskRipple. Since the trigger code is not provided not sure where the error is thrown. Please check the trigger, maybe add some debugs and check where the error gets thrown.
Agreed, can you post the trigger? The issue is not with the test method according to the debug log.
--KC
it's a proble with your trigger, on the task. you should post the code.
Thanks for all the replies. I was able to track down where the error was in the trigger. I had neglected to check for a null value prior to using a variable...
I'm all good. thanks.