• helpForce
  • 0 Points
  • Member since 2008

  • Chatter
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
  • 6

I have setup Cronkit in my sandbox,  I have it running every hour to fire a trigger I wrote.  It worked the first 30 times, then it just started saying it was late and not running.  I then restarted it, and it ran the first few times again and said it was late. 


What causes it to be late?


Its not an Apex Error... 






I've noticed that when setting Dataloader's batch size option to 200, triggers are operating in batches of 100. This is not a problem in itself, but I've also noticed that static variables are not cleared between the 100 batch runs. I've included a short example below, but basically all I'd like to know is:

Why are the Dataloader batches broken up, and when does this happen?
Should the static variables be cleared automatically?

As I say, here's a quick example; it's a trigger on Contact and a class with a static variable:

public class quickClass {
    public static boolean lock = false;

trigger quick on Contact (before insert) { 
    System.debug('lock: ' + quickClass.lock);
    quickClass.lock = true;
    System.debug('Trigger.new.size(): ' + Trigger.new.size());

When we insert, say, 150 Contacts, using Dataloader with a batch size of 200 in the log file we will see:

lock: false
Trigger.new.size(): 100
lock: true
Trigger.new.size(): 50

It doesn't look like it's Dataloader fault - it does look like it's sending 150 Contacts, rather than 100 and then 50.

Like I say, I don't mind the process being broken up, but obviously I'd also like the static variables to be cleared between the processing of the first 100 records finishing, and the processing of the next 50 records starting, as we are using static variables to control execution flow. If these variables are keeping their value, it causes a problem for us!

Hope that's enough detail, thanks in advance for any help...

  • December 05, 2008
  • Like
  • 1
I basically want to hide some panel in my page to do that I want to update the variable Modif_mode :
The default Value is false this value should be update to true when I click on my commandLink but nothing happen
Any Idea ?
<apex:outputpanel id="Mode">
           <apex:outputlabel  value="{!Modif_mode}" />

<apex:pageBlockTable value="{!Opportunity.OpportunityLineItems}" var="opplis" id="line_items" >
          <apex:column headerValue="Action">        
                <apex:commandLink rerender="Mode">Modif
                          <apex:param name="Modif_mode" value="true" assignTo="{!Modif_mode}"/>
controller :

Boolean Modif_mode = false;

public boolean getModif_mode() {return Modif_mode;}

public Void setModif_mode (Boolean b) { Modif_mode = b; }



  • August 07, 2008
  • Like
  • 0