• MRK-NJ
  • NEWBIE
  • 0 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 2
    Replies

Hello,

 

I am looking to identify when I have exceeded my 24 hour limit on @future calls.

 

Reading the documentation   I thoutht that the limits.getLimitFutureCalls() and limits.getFutureCalls() methods would do the trick.  However, this is measuring the "No more than 10 method calls per Apex invocation".

 

I am looking for a method to identify the 24 hour limit of 200 future calls per user. Are there methods for this? I can't find them in the docs

 

Thanks so much.

 

As an FYI

I created a simple test case

 

global class MyFutureClass {
@future
public static void myMethod(String a, Integer i) {
System.debug('Method called with: ' + a + ' and ' + i);
//do callout, other long running code
}
}

 

I then executed the following code in the developer console

System.debug (logginglevel.WARN,'**# Limits future calls:' + limits.getLimitFutureCalls()+' future calls:'+ limits.getFutureCalls());
myFutureClass.myMethod('first',1);
System.debug (logginglevel.WARN,'**# Limits future calls:' + limits.getLimitFutureCalls()+' future calls:'+ limits.getFutureCalls());
myFutureClass.myMethod('2',2);
System.debug (logginglevel.WARN,'**# Limits future calls:' + limits.getLimitFutureCalls()+' future calls:'+ limits.getFutureCalls());
myFutureClass.myMethod('3',3);
System.debug (logginglevel.WARN,'**# Limits future calls:' + limits.getLimitFutureCalls()+' future calls:'+ limits.getFutureCalls());
myFutureClass.myMethod('4',4);
System.debug (logginglevel.WARN,'**# Limits future calls:' + limits.getLimitFutureCalls()+' future calls:'+ limits.getFutureCalls());
myFutureClass.myMethod('5',5);

 

 

 

 

 

 

Hello,

 

I am having difficulty setting values on my controller using the Visualforce Apex Repeat tag.  Fundamentally when an element is changed in the repeat section the contoller set method is not being called.  Please see the case below.

 

<apex:page controller="TestSessionController" cache="false" >

  <apex:form >
     If I changed a row shouldn't the set method be called in my controller ?   <br/>
     <apex:repeat first="0"  value="{!SearchOptionTestInt}" var="sob">
                        <apex:inputText id="inBox" value="{!sob.label}"/>
                        <apex:inputCheckbox id="inBox2" selected="{!sob.label}" value="{!sob.selected}"/>
                       <br/>
                </apex:repeat>        
    <br/>
    <apex:commandButton action="{!go}" value="go" immediate="false">
        </apex:commandButton>
        
   
   
 </apex:form>
 Showing all the values      
   SearchOptionTest:{!SearchOptionTestInt}
</apex:page> public class TestSessionController {


public list<SearchOption> SearchOptionTestInt = new  list<SearchOption>();
 public list<SearchOption> getSearchOptionTestInt () {return(SearchOptionTestInt);}
 public void setSearchOptionTestInt (list<SearchOption> setSearchOptionTestInt )
     {//Do stuff to see if set method is being fired
system.debug(logginglevel.WARN,'### Set opt' + opt);
      system.debug(logginglevel.WARN,'### Set SearchOptionTestInt' + SearchOptionTestInt);
       SearchOption test =  new SearchOption();
       test.label='Hurray the Set Method was called' + string.valueof(SearchOptionTestInt.size());
       test.selected=false;
 
      SearchOptionTestInt.add(test);
      this.SearchOptionTestInt=SearchOptionTestInt;
     }

public TestSessionController() {
    
       SearchOption Init = new SearchOption();
       Init.label= string.valueof(system.now())+' init 1:' + string.valueof(SearchOptionTestInt.size());
       Init.selected=false;
       system.debug(logginglevel.WARN,'### Init' + Init);
       SearchOptionTestInt.add(Init);
        SearchOption Init2 = new SearchOption();
        Init2.label=string.valueof(system.now())+' init 2: ' + string.valueof(SearchOptionTestInt.size());
       Init2.selected=true;
       system.debug(logginglevel.WARN,'### Init2' + Init2);
       SearchOptionTestInt.add(Init2);
        SearchOption Init3 = new SearchOption();
       Init3.label=string.valueof(system.now())+' init3: ' + string.valueof(SearchOptionTestInt.size());
       Init3.selected=false;
       system.debug(logginglevel.WARN,'### Init3' + Init3);
       SearchOptionTestInt.add(Init3);
       system.debug(logginglevel.WARN,'### Init SearchOptionTestInt:' + SearchOptionTestInt);}

public pageReference Go (){
  pagereference pr = page.TestSession;
  return (pr);   
   }
   
 
       public class SearchOption {
 
    public string label {get; set;}
    public boolean selected {get; set;}
   
    }
        }

 

 

No matter what I do I have been unable to get the set method  to fire. 

What is the right way to force this behavoir?   The problem seems unique to the repeat function.

 

 

Note: On 5/22/12 at 10:20 am est.  I changed the code to illustrate the problem more cleanly.

           I have experimented with the commandbutton "immediate" parameter and also .  It does not impact my problem.

 

 

Thank you so much for your help.

 

 

Hello,

 

I have am building an application using visualforce pages to create complex forms for medical interviews.

I have hundreds fields and 20 forms, so I am very concerned about future maintainability of the forms and keeping the labels and help text on the forms in sync with the salesforce fields/reports and page layouts.

 

So  I would like to display the label and custom help field data on the form for each field for example:

 

Field Label: Customer Primary Concern


Help Text: Write down the customers primary concern in his of her own words

 

I would like to display the following on the VisualForce page:

 

 Customer Primary Concern (Write down the customers primary concern in his of her own words)

     this is a text area

I want the help text to persist on the page and want to be able to format it with css, rather then be a hover button 

 

So ideally the code for this would look like this


<apex:outputtext value={"contact.Customer_Primary_Concern__c.Label"}>

(<apex:outputtext value={"contact.Customer_Primary_Concern__c.HelpText"}>)<br/>

<apex:inputTextarea value="{!contact.Customer_Primary_Concern__c}"/>


 How do I refer to the Label and Help text fields on a visualforce page.

 

 

Thank you so much for your help.

Cheers,

Martin

 

 

 

 

 

  • April 13, 2012
  • Like
  • 0

Hello,

 

I am having difficulty setting values on my controller using the Visualforce Apex Repeat tag.  Fundamentally when an element is changed in the repeat section the contoller set method is not being called.  Please see the case below.

 

<apex:page controller="TestSessionController" cache="false" >

  <apex:form >
     If I changed a row shouldn't the set method be called in my controller ?   <br/>
     <apex:repeat first="0"  value="{!SearchOptionTestInt}" var="sob">
                        <apex:inputText id="inBox" value="{!sob.label}"/>
                        <apex:inputCheckbox id="inBox2" selected="{!sob.label}" value="{!sob.selected}"/>
                       <br/>
                </apex:repeat>        
    <br/>
    <apex:commandButton action="{!go}" value="go" immediate="false">
        </apex:commandButton>
        
   
   
 </apex:form>
 Showing all the values      
   SearchOptionTest:{!SearchOptionTestInt}
</apex:page> public class TestSessionController {


public list<SearchOption> SearchOptionTestInt = new  list<SearchOption>();
 public list<SearchOption> getSearchOptionTestInt () {return(SearchOptionTestInt);}
 public void setSearchOptionTestInt (list<SearchOption> setSearchOptionTestInt )
     {//Do stuff to see if set method is being fired
system.debug(logginglevel.WARN,'### Set opt' + opt);
      system.debug(logginglevel.WARN,'### Set SearchOptionTestInt' + SearchOptionTestInt);
       SearchOption test =  new SearchOption();
       test.label='Hurray the Set Method was called' + string.valueof(SearchOptionTestInt.size());
       test.selected=false;
 
      SearchOptionTestInt.add(test);
      this.SearchOptionTestInt=SearchOptionTestInt;
     }

public TestSessionController() {
    
       SearchOption Init = new SearchOption();
       Init.label= string.valueof(system.now())+' init 1:' + string.valueof(SearchOptionTestInt.size());
       Init.selected=false;
       system.debug(logginglevel.WARN,'### Init' + Init);
       SearchOptionTestInt.add(Init);
        SearchOption Init2 = new SearchOption();
        Init2.label=string.valueof(system.now())+' init 2: ' + string.valueof(SearchOptionTestInt.size());
       Init2.selected=true;
       system.debug(logginglevel.WARN,'### Init2' + Init2);
       SearchOptionTestInt.add(Init2);
        SearchOption Init3 = new SearchOption();
       Init3.label=string.valueof(system.now())+' init3: ' + string.valueof(SearchOptionTestInt.size());
       Init3.selected=false;
       system.debug(logginglevel.WARN,'### Init3' + Init3);
       SearchOptionTestInt.add(Init3);
       system.debug(logginglevel.WARN,'### Init SearchOptionTestInt:' + SearchOptionTestInt);}

public pageReference Go (){
  pagereference pr = page.TestSession;
  return (pr);   
   }
   
 
       public class SearchOption {
 
    public string label {get; set;}
    public boolean selected {get; set;}
   
    }
        }

 

 

No matter what I do I have been unable to get the set method  to fire. 

What is the right way to force this behavoir?   The problem seems unique to the repeat function.

 

 

Note: On 5/22/12 at 10:20 am est.  I changed the code to illustrate the problem more cleanly.

           I have experimented with the commandbutton "immediate" parameter and also .  It does not impact my problem.

 

 

Thank you so much for your help.

 

 

Hello,

 

I have am building an application using visualforce pages to create complex forms for medical interviews.

I have hundreds fields and 20 forms, so I am very concerned about future maintainability of the forms and keeping the labels and help text on the forms in sync with the salesforce fields/reports and page layouts.

 

So  I would like to display the label and custom help field data on the form for each field for example:

 

Field Label: Customer Primary Concern


Help Text: Write down the customers primary concern in his of her own words

 

I would like to display the following on the VisualForce page:

 

 Customer Primary Concern (Write down the customers primary concern in his of her own words)

     this is a text area

I want the help text to persist on the page and want to be able to format it with css, rather then be a hover button 

 

So ideally the code for this would look like this


<apex:outputtext value={"contact.Customer_Primary_Concern__c.Label"}>

(<apex:outputtext value={"contact.Customer_Primary_Concern__c.HelpText"}>)<br/>

<apex:inputTextarea value="{!contact.Customer_Primary_Concern__c}"/>


 How do I refer to the Label and Help text fields on a visualforce page.

 

 

Thank you so much for your help.

Cheers,

Martin

 

 

 

 

 

  • April 13, 2012
  • Like
  • 0