• Critter
  • NEWBIE
  • 0 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 7
    Replies

I need to do some processing based on whether a checkbox (inputcheckbox) is checked on page SAVE.

 

after searching around, all I have seen are references to using a wrapper class, which seems a little bit overboard for what I am looking to do.

 

Is there an easier way to tell if a checkbox is checked?

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..

  • September 21, 2012
  • Like
  • 0

I have triggers attached to several objects for our group.

 

The creation of cloning of a top level object trickles down and clones everything associated with /that/ object. Easy enough.

 

but in that cloning of child objects other triggers are fired to perform this and that.. It seems I am hitting my sql query cap.

 

My question : Does the 100 query cap run /per/ trigger or is it cummulative of all processes run from the initial trigger?

 

 

  • September 13, 2012
  • Like
  • 0

Basically I need to do a recursive clone of an object and all it's children.

 

I was initially hoping to intercept the standard clone event using a trigger, and capture the clone variable in the query using:

 

URL.getCurrentRequestUrl().getQuery());

 

hoping to find "clone=1" somewhere in the string, but it only returns a null, so I am assuming there is a page redirect or such before the trigger is executed.

 

any suggestions on how to best catch the 'clone' so that I can do my thing and clone all the related items?

I need to do some processing based on whether a checkbox (inputcheckbox) is checked on page SAVE.

 

after searching around, all I have seen are references to using a wrapper class, which seems a little bit overboard for what I am looking to do.

 

Is there an easier way to tell if a checkbox is checked?

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..

  • September 21, 2012
  • Like
  • 0

I have triggers attached to several objects for our group.

 

The creation of cloning of a top level object trickles down and clones everything associated with /that/ object. Easy enough.

 

but in that cloning of child objects other triggers are fired to perform this and that.. It seems I am hitting my sql query cap.

 

My question : Does the 100 query cap run /per/ trigger or is it cummulative of all processes run from the initial trigger?

 

 

  • September 13, 2012
  • Like
  • 0

Basically I need to do a recursive clone of an object and all it's children.

 

I was initially hoping to intercept the standard clone event using a trigger, and capture the clone variable in the query using:

 

URL.getCurrentRequestUrl().getQuery());

 

hoping to find "clone=1" somewhere in the string, but it only returns a null, so I am assuming there is a page redirect or such before the trigger is executed.

 

any suggestions on how to best catch the 'clone' so that I can do my thing and clone all the related items?