• jdk4702
  • NEWBIE
  • 30 Points
  • Member since 2010

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 12
    Replies

I have a managed package that runs batch apex every night for those that install it.  I pushed a fix to those orgs the other evening via push upgrades.  Now 2 customers who didn't have any problems before threw exceptions.

 

It sounds like the Apex Scheduler might be having issues - is that the likely issue or is it possible there's something funky with my code?

 

Upon further review, there was another error just prior to this one:

 

Developer script exception from Oceaneering International, Inc. : 'chttrunfollow.UnfollowQueueDelayRecordsBatch' : Unable to write to any of the cursor stores in the alloted time

 

Error message:

Developer script exception from Oceaneering International, Inc. : 'chttrunfollow.UnfollowQueueDelayRecordsBatch' : Unable to write to any of the ACS stores in the alloted time.

 

I have a list view button that lets you select records and it does stuff with the selected records.


However, I can't find any info on how to NOT navigate to a new page after clicking the button. 

 

My ideal solution is:

1) Click button

2) Controller determines the conformation or error message

3) Add confirmation or error message to the List view

 

So far I have a crappy workaround with the VF page showing the error + a back link:

 

 

<apex:page standardController="Replacer__c" recordSetVar="r" extensions="replacerRunAllSelectedRulesController" action="{!runSelectedRules}">
    <apex:pagemessages />
    <A HREF="javascript&colon;javascript&colon;history.go(-1)">Back to previous page</A>
</apex:page>

 

The relevent parts of my controller:

 

public with sharing class replacerRunAllSelectedRulesController{

    ApexPages.StandardSetController setCon;
    private PageReference savePage;

    public replacerRunAllSelectedRulesController(ApexPages.StandardController controller) {
        //Not sure why this is needed...
    }//replacerRunAllSelectedRulesController

    public replacerRunAllSelectedRulesController(ApexPages.StandardSetController controller) {
        setCon=controller;
        List<Replacer__c> selectedRules=new List<Replacer__c>();
    }//replacerRunAllSelectedRulesController
    
    public PageReference runSelectedRules(){
        List<Replacer__c> selectedRules=new List<Replacer__c>();
        for(sObject s: setCon.getSelected()){
            Replacer__c r=(Replacer__c)s;
            selectedRules.add(r);
        }//for 1
        String objectName='';
        Boolean sendEmail=TRUE;
        
        if(selectedRules.size()==0){
        	ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, 
        	'You must select at least one rule.  Please go back and select a rule by checking the checkbox and try again.'));        
        }else{
	        
	        Integer numJobsCantBeRunNow=replacerExecute.replacerQueueBatchJobs(objectName, selectedRules, sendEmail);
	        if(numJobsCantBeRunNow==0){
	            ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.CONFIRM,'Replacement has begun.  This can take ~10-30 minutes for each 10,000 records.  You will receive 1 email confirmation for each different object as all rules for one object are run together in one job.');
	            ApexPages.addMessage(myMsg);
	        }else{
	            //else throw an error that they need to select fewer rules to run right now
	            ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, 'The selected rules cannot be run now as they would exceed your companies batch job limit of 5.  One job is created for each different object.  Please unselect ' + numJobsCantBeRunNow + ' object\'s rules and try again.  To view the batch queue, click Setup-->Monitoring-->Apex Jobs'));
	        }//if 2
        }//if 1
        
        return ApexPages.CurrentPage();
    }//runSelectedRules
    
}//replacerRunAllSelectedRulesController

 

 

 

 

 

If the SFDC solution is too complicated, does anyone have a javascript solution that works here?

 

Thanks!

I'm attempting to implement this method to create a List View button that gets the selected rows & pass them to another method, but I'm getting an error :

 

 

Illegal view ID runSelectedRules. The ID must begin with /

 

Are these buttons supposed to return a page reference?  If so, how to I get the list view ID to return to the page after the controller method completes?

 

 

My List View button points to this VF page:

 

<apex:page standardController="Replacer__c" recordSetVar="r" extensions="replacerRunAllSelectedRulesController" action="runSelectedRules">
    
</apex:page>

 

 

Which call this controller when clicked:

 

public with sharing class replacerRunAllSelectedRulesController{

    ApexPages.StandardSetController setCon;

    public replacerRunAllSelectedRulesController(ApexPages.StandardController controller) {
        //Not sure why this is needed...
    }//replacerRunAllSelectedRulesController

    public replacerRunAllSelectedRulesController(ApexPages.StandardSetController controller) {
        setCon=controller;
    }//replacerRunAllSelectedRulesController
    
    public PageReference runSelectedRules(){
        List<Replacer__c> selectedRules=new List<Replacer__c>();
        for(sObject s: setCon.getSelected()){
            Replacer__c r=(Replacer__c)s;
            selectedRules.add(r);
        }//for 1
        String objectName='';
        Boolean sendEmail=TRUE;
        Integer numJobsCantBeRunNow=replacerExecute.replacerQueueBatchJobs(objectName, selectedRules, sendEmail);
        
//        return ApexPages.CurrentPage();
    }//runSelectedRules
    
}//replacerRunAllSelectedRulesController

I've tried other combo's too - putting the code in the set controller init and calling init, trying to return a different page ref, trying to return no pageref, but haven't hit anything that works yet :(

 

I should add that in all of my iterations, the debug logs show all the code runs, but nothing actually happens (methods aren't committed?).

I'm stuck trying to actually set the set controller page number - my best try simply refreshes the page, leaving the page unchanged.

 

VF Snippet:

 

 

Page <apex:inputText value="{!pageNum}">
                        <apex:actionSupport event="onchange" action="{!setPageNum}"/>
                    </apex:inputText> 
                of "{!totalPages}"

 Controller snippet:

 

 

public Integer pageNum{
        get{
            return setCon.getPageNumber();
        }//get
        set;
    }//pageNum

    public Integer totalPages{ 
        get{
            Integer numPages =setCon.getResultSize()/setcon.getPageSize();
            if(numPages*setcon.getPageSize()!=setCon.getResultSize()){
                numPages++;
            }//if 
            return numPages;
        }//get
        set;
    }//total pages

    public void next() {
        setCon.next();
    }//next
    
    public void previous() {
        setCon.previous();                
    }//previous

    public void setPageNum(){
        setCon.setPageNumber(pageNum);
    }//setPageNum

 

Perhaps pageNum does the "get" method when setPageNumber() tries to get the changed value and resets it to the "unchanged" value?

 

Thx for the help!

 

 

This should be simple, but I can't figure it out.

 

I have a repeated list of record ID's, and I want to link them all to the respective record, the same way a list view links the Name field to the record.

 

 

<apex:pageBlock>
        <apex:panelgroup >
            <apex:pageblocktable value="{!sRecords}" var="r" >
                <apex:column >
                    <apex:commandLink value="{!r.Id}"  action="{!linkToRecord}">//How do I pass r.Id to the controller method?                                        
                    </apex:commandLink> 
                </apex:column>
            </apex:pageblocktable>
        </apex:panelgroup>
    </apex:pageBlock>

 

public PageReference linkToRecord() {
      String recordId='001A000000P4ZYy';//How do I make this a variable based on the Id clicked?
      PageReference recordPage= new PageReference('/'+recordId);
      return recordPage;
    }

 

 

 

How do I rerender a StandardSetController? I've seen these posts indicating that I should requery the query locator, but I can't determine how to trigger the requery upon rerender, as I assumed that would happen automatically upon rerender.

http://community.salesforce.com/t5/Apex-Code-Development/Reload-StandardSetController-Records/m-p/193333

http://community.salesforce.com/t5/Visualforce-Development/Rerender-problem/td-p/173007

 

 

I'm not sure how to "make StandardSetController a property and re-initialize it".

 

My not working code:

 

 

<apex:page controller="testGetter">
<apex:pageblock>
<apex:form>
<APex:pageblocksection>
<apex:selectList value="{!inputBox}" size="1" title="Object List">
<apex:selectOptions value="{!rObjectsInUse}"></apex:selectOptions>
</apex:selectList>
<apex:commandButton rerender="preview" value="click me"> //when clicked, this should rerender the pageblocktable, but doesn't
</apex:commandbutton>
</apex:pageblocksection>
</apex:form>
</apex:pageBlock>

<apex:pageblock>

<apex:pageBlockSection id="preview">
<apex:outputtext value="{!inputbox}"/>
<br/>
<apex:pageBlockTable value="{!sRecords}" var="r"> //Doesn't rerender
<apex:column value="{!r.Id}"/>
</apex:pageBlockTable>
</apex:pageBlockSection>
</apex:pageBlock>

</apex:page>

 

public with sharing class testGetter {

public String inputBox { get
{
system.debug('input box is: '+inputBox);
if(inputbox==null){
inputbox='Account';
}
return inputBox;
}

set; }

public List<SelectOption> getrObjectsInUse(){
List<SelectOption> options = new List<SelectOption>();
// AggregateResult[] ars=[SELECT objectName__c name1 FROM Replacer__c WHERE objectName__c!=null AND Active__c=True GROUP BY objectName__c];

// if(ars.size()>0){
// for (AggregateResult ar:ars){//for 1
// String objectName=String.valueof(ar.get('name1'));
options.add(new selectOption('Account','Account'));
options.add(new selectOption('Contact','Contact'));
options.add(new selectOption('Lead','Lead'));
// }//for 1
// }//if 1
return options;
}

public String recordQuerySQL(){
String recordQuerySQL = 'SELECT Id FROM '+inputBox;
system.debug('ObjectName :'+inputBox);
//make this query logic dynamic based on:
//1) Object
//2) Fields in the rules
//3) Records that meet the "find" criteria
return recordQuerySQL;
}//recordQuerySQL

public ApexPages.StandardSetController setCon{
get {
if(setCon==null){
String query = recordQuerySQL();
setCon = new ApexPages.StandardSetController(Database.getQueryL ocator(query));//how do I update this query for the set controller upon button click, which rerenders the PageBlockTable?
}
return setCon;
}//get
private set;
}//sRecords
public List<sObject> getsRecords() {
return (List<sObject>) setCon.getRecords();
}
}

 

I have a managed package that runs batch apex every night for those that install it.  I pushed a fix to those orgs the other evening via push upgrades.  Now 2 customers who didn't have any problems before threw exceptions.

 

It sounds like the Apex Scheduler might be having issues - is that the likely issue or is it possible there's something funky with my code?

 

Upon further review, there was another error just prior to this one:

 

Developer script exception from Oceaneering International, Inc. : 'chttrunfollow.UnfollowQueueDelayRecordsBatch' : Unable to write to any of the cursor stores in the alloted time

 

Error message:

Developer script exception from Oceaneering International, Inc. : 'chttrunfollow.UnfollowQueueDelayRecordsBatch' : Unable to write to any of the ACS stores in the alloted time.

 

I'm attempting to implement this method to create a List View button that gets the selected rows & pass them to another method, but I'm getting an error :

 

 

Illegal view ID runSelectedRules. The ID must begin with /

 

Are these buttons supposed to return a page reference?  If so, how to I get the list view ID to return to the page after the controller method completes?

 

 

My List View button points to this VF page:

 

<apex:page standardController="Replacer__c" recordSetVar="r" extensions="replacerRunAllSelectedRulesController" action="runSelectedRules">
    
</apex:page>

 

 

Which call this controller when clicked:

 

public with sharing class replacerRunAllSelectedRulesController{

    ApexPages.StandardSetController setCon;

    public replacerRunAllSelectedRulesController(ApexPages.StandardController controller) {
        //Not sure why this is needed...
    }//replacerRunAllSelectedRulesController

    public replacerRunAllSelectedRulesController(ApexPages.StandardSetController controller) {
        setCon=controller;
    }//replacerRunAllSelectedRulesController
    
    public PageReference runSelectedRules(){
        List<Replacer__c> selectedRules=new List<Replacer__c>();
        for(sObject s: setCon.getSelected()){
            Replacer__c r=(Replacer__c)s;
            selectedRules.add(r);
        }//for 1
        String objectName='';
        Boolean sendEmail=TRUE;
        Integer numJobsCantBeRunNow=replacerExecute.replacerQueueBatchJobs(objectName, selectedRules, sendEmail);
        
//        return ApexPages.CurrentPage();
    }//runSelectedRules
    
}//replacerRunAllSelectedRulesController

I've tried other combo's too - putting the code in the set controller init and calling init, trying to return a different page ref, trying to return no pageref, but haven't hit anything that works yet :(

 

I should add that in all of my iterations, the debug logs show all the code runs, but nothing actually happens (methods aren't committed?).

I'm stuck trying to actually set the set controller page number - my best try simply refreshes the page, leaving the page unchanged.

 

VF Snippet:

 

 

Page <apex:inputText value="{!pageNum}">
                        <apex:actionSupport event="onchange" action="{!setPageNum}"/>
                    </apex:inputText> 
                of "{!totalPages}"

 Controller snippet:

 

 

public Integer pageNum{
        get{
            return setCon.getPageNumber();
        }//get
        set;
    }//pageNum

    public Integer totalPages{ 
        get{
            Integer numPages =setCon.getResultSize()/setcon.getPageSize();
            if(numPages*setcon.getPageSize()!=setCon.getResultSize()){
                numPages++;
            }//if 
            return numPages;
        }//get
        set;
    }//total pages

    public void next() {
        setCon.next();
    }//next
    
    public void previous() {
        setCon.previous();                
    }//previous

    public void setPageNum(){
        setCon.setPageNumber(pageNum);
    }//setPageNum

 

Perhaps pageNum does the "get" method when setPageNumber() tries to get the changed value and resets it to the "unchanged" value?

 

Thx for the help!

 

 

This should be simple, but I can't figure it out.

 

I have a repeated list of record ID's, and I want to link them all to the respective record, the same way a list view links the Name field to the record.

 

 

<apex:pageBlock>
        <apex:panelgroup >
            <apex:pageblocktable value="{!sRecords}" var="r" >
                <apex:column >
                    <apex:commandLink value="{!r.Id}"  action="{!linkToRecord}">//How do I pass r.Id to the controller method?                                        
                    </apex:commandLink> 
                </apex:column>
            </apex:pageblocktable>
        </apex:panelgroup>
    </apex:pageBlock>

 

public PageReference linkToRecord() {
      String recordId='001A000000P4ZYy';//How do I make this a variable based on the Id clicked?
      PageReference recordPage= new PageReference('/'+recordId);
      return recordPage;
    }

 

 

 

How do I rerender a StandardSetController? I've seen these posts indicating that I should requery the query locator, but I can't determine how to trigger the requery upon rerender, as I assumed that would happen automatically upon rerender.

http://community.salesforce.com/t5/Apex-Code-Development/Reload-StandardSetController-Records/m-p/193333

http://community.salesforce.com/t5/Visualforce-Development/Rerender-problem/td-p/173007

 

 

I'm not sure how to "make StandardSetController a property and re-initialize it".

 

My not working code:

 

 

<apex:page controller="testGetter">
<apex:pageblock>
<apex:form>
<APex:pageblocksection>
<apex:selectList value="{!inputBox}" size="1" title="Object List">
<apex:selectOptions value="{!rObjectsInUse}"></apex:selectOptions>
</apex:selectList>
<apex:commandButton rerender="preview" value="click me"> //when clicked, this should rerender the pageblocktable, but doesn't
</apex:commandbutton>
</apex:pageblocksection>
</apex:form>
</apex:pageBlock>

<apex:pageblock>

<apex:pageBlockSection id="preview">
<apex:outputtext value="{!inputbox}"/>
<br/>
<apex:pageBlockTable value="{!sRecords}" var="r"> //Doesn't rerender
<apex:column value="{!r.Id}"/>
</apex:pageBlockTable>
</apex:pageBlockSection>
</apex:pageBlock>

</apex:page>

 

public with sharing class testGetter {

public String inputBox { get
{
system.debug('input box is: '+inputBox);
if(inputbox==null){
inputbox='Account';
}
return inputBox;
}

set; }

public List<SelectOption> getrObjectsInUse(){
List<SelectOption> options = new List<SelectOption>();
// AggregateResult[] ars=[SELECT objectName__c name1 FROM Replacer__c WHERE objectName__c!=null AND Active__c=True GROUP BY objectName__c];

// if(ars.size()>0){
// for (AggregateResult ar:ars){//for 1
// String objectName=String.valueof(ar.get('name1'));
options.add(new selectOption('Account','Account'));
options.add(new selectOption('Contact','Contact'));
options.add(new selectOption('Lead','Lead'));
// }//for 1
// }//if 1
return options;
}

public String recordQuerySQL(){
String recordQuerySQL = 'SELECT Id FROM '+inputBox;
system.debug('ObjectName :'+inputBox);
//make this query logic dynamic based on:
//1) Object
//2) Fields in the rules
//3) Records that meet the "find" criteria
return recordQuerySQL;
}//recordQuerySQL

public ApexPages.StandardSetController setCon{
get {
if(setCon==null){
String query = recordQuerySQL();
setCon = new ApexPages.StandardSetController(Database.getQueryL ocator(query));//how do I update this query for the set controller upon button click, which rerenders the PageBlockTable?
}
return setCon;
}//get
private set;
}//sRecords
public List<sObject> getsRecords() {
return (List<sObject>) setCon.getRecords();
}
}

 

Hi,

If I am running a campaign to target a number of Accounts and I would like to show on those accounts that they have been targeted by the campaign, is there an easy way to do this?

I have ran a report to obtain the accounts that are going to be targeted and exported it to Excel , but when I create a new campaign I cannot find a way to select which accounts it is going to be linked with.

Thanks in advance for any help provided.

Hi there,

 

I am having rerender issues. I have a commandLink button and when I click it I am putting a campaign record in the controller.  I have a outputPanel in the bottom of the commandLink button which holds a tabPanel. In the tabPanel, I am showing Contacts and Leads in the Campaign.  I have the rerender property of the commandLink set to outputPanel Id, because I only want to render this when they click the select button.  Also, I have an inline IF statement that checks if the campaign is null and if it's then don't render the Panel. When I click the select button it doesn't do anything. Can someone help me figure this out please. Thank you.

 

visualforce Page: <apex:page Controller="pagingController"> <style> .activeTab {background-color: #236FBD; color:white; background-image:none} .inactiveTab { background-color: lightgrey; color:black; background-image:none} </style> <apex:form > <apex:commandLink value="Select" action="{!pullCampaign}" styleClass="btn" rerender="campaignContactsAndLeads"> <apex:param name="campaignId" value="{!campaign.Id}" /> </apex:commandLink> <apex:outputPanel id="campaignContactsAndLeads" rendered="{!IF(ISNULL(campaign), false, true)}"> <apex:tabPanel switchType="client" selectedTab="tabCampaigns" id="MailingListTabPanel" tabClass="activeTab" inactiveTabClass="inactiveTab"> <apex:tab label="Contacts" name="contactSec" id="tabContacts"> <apex:pageBlock title="Category Results - Page #{!pageNumber}" > <apex:pageBlockTable id="cMContacts" value="{!Contacts}" var="cont"> <apex:column headerValue="First Name"> <apex:outputField value="{!cont.FirstName}"/>&nbsp; </apex:column> <apex:column headerValue="Last Name"> <apex:outputField value="{!cont.LastName}" />&nbsp; </apex:column> <apex:column headerValue="Mailing City"> <apex:outputField value="{!cont.MailingCity}"/>&nbsp; </apex:column> <apex:column headerValue="Mailing Country"> <apex:outputField value="{!cont.MailingCountry}" />&nbsp; </apex:column> </apex:pageBlockTable> </apex:pageBlock> <apex:panelGrid columns="4" id="contactLinks"> <apex:commandLink action="{!first}" rerender="cMContacts, contactLinks">First</apex:commandlink> <apex:commandLink action="{!previous}" rerender="cMContacts, contactLinks" rendered="{!hasPrevious}">Previous</apex:commandlink> <apex:commandLink action="{!next}" rendered="{!hasNext}" rerender="cMContacts, contactLinks">Next</apex:commandlink> <apex:commandLink action="{!last}" rerender="cMContacts, contactLinks">Last</apex:commandlink> </apex:panelGrid> </apex:tab> <apex:tab label="Leads" name="leadSec" id="tabLeads"> <apex:pageBlock title="Category Results - Page #{!pageNumberLead}" > <apex:pageBlockTable id="cMLeads" value="{!Leads}" var="leadM"> <apex:column headerValue="First Name"> <apex:outputField value="{!leadM.FirstName}"/>&nbsp; </apex:column> <apex:column headerValue="Last Name"> <apex:outputField value="{!leadM.LastName}" />&nbsp; </apex:column> <apex:column headerValue="Mailing City"> <apex:outputField value="{!leadM.City}"/>&nbsp; </apex:column> <apex:column headerValue="Mailing Country"> <apex:outputField value="{!leadM.Country}" />&nbsp; </apex:column> </apex:pageBlockTable> </apex:pageBlock> <apex:panelGrid columns="4" id="leadLinks"> <apex:commandLink action="{!firstLead}" rerender="cMLeads, leadLinks">First</apex:commandlink> <apex:commandLink action="{!previousLead}" rerender="cMLeads, leadLinks" rendered="{!hasPreviousLead}">Previous</apex:commandlink> <apex:commandLink action="{!nextLead}" rerender="cMLeads, leadLinks" rendered="{!hasNextLead}">Next</apex:commandlink> <apex:commandLink action="{!lastLead}" rerender="cMLeads, leadLinks">Last</apex:commandlink> </apex:panelGrid> </apex:tab> </apex:tabPanel> </apex:outputPanel> </apex:form> </apex:page> Controller code: public with sharing class pagingController { Campaign campaign; public void pullCampaign() { campaign = [SELECT Id, Name FROM Campaign WHERE Id = :'701A00000000kGz']; } public Campaign getCampaign() { return campaign; } // instantiate the StandardSetController from a query locator public ApexPages.StandardSetController con { get { if(con == null) { con = new ApexPages.StandardSetController( Database.getQueryLocator([ SELECT Id, FirstName, LastName, MailingCity, MailingCountry FROM Contact Where Id in ( Select ContactId From CampaignMember where campaignId =:campaign.Id And ContactId <> null)])); // sets the number of records in each page set con.setPageSize(5); } return con; } set; } // indicates whether there are more records after the current page set. public Boolean hasNext { get { return con.getHasNext(); } set; } // indicates whether there are more records before the current page set. public Boolean hasPrevious { get { return con.getHasPrevious(); } set; } // returns the page number of the current page set public Integer pageNumber { get { return con.getPageNumber(); } set; } // returns the first page of records public void first() { con.first(); } // returns the last page of records public void last() { con.last(); } // returns the previous page of records public void previous() { con.previous(); } // returns the next page of records public void next() { con.next(); } // returns the PageReference of the original page, if known, or the home page. public void cancel() { con.cancel(); } public List<Contact> getContacts() { return (List<Contact>) con.getRecords(); } // instantiate the StandardSetController from a query locator public ApexPages.StandardSetController lead { get { if(lead == null) { lead = new ApexPages.StandardSetController( Database.getQueryLocator([ SELECT Id, FirstName, LastName, City, Country FROM Lead Where Id in ( Select LeadId From CampaignMember where CampaignId =:campaign.Id And LeadId <> null)])); // sets the number of records in each page set lead.setPageSize(5); } return lead; } set; } // indicates whether there are more records after the current page set. public Boolean hasNextLead { get { return lead.getHasNext(); } set; } // indicates whether there are more records before the current page set. public Boolean hasPreviousLead { get { return lead.getHasPrevious(); } set; } // returns the page number of the current page set public Integer pageNumberLead { get { return lead.getPageNumber(); } set; } // returns the first page of records public void firstLead() { lead.first(); } // returns the last page of records public void lastLead() { lead.last(); } // returns the previous page of records public void previousLead() { lead.previous(); } // returns the next page of records public void nextLead() { lead.next(); } // returns the PageReference of the original page, if known, or the home page. public void cancelLead() { lead.cancel(); } public List<Lead> getLeads() { return (List<Lead>) lead.getRecords(); } }

 

Hi,

 

I've created a StandardSetController extension and a Visualforce page with a pageblocktable that displays a list of records from a custom object.

 

At the Visualforce page I do some ajax calls to delete a record from this object, then I do a rerender of the pageblocktable to display the list *without* the recently deleted record, but it stills at the list.

 

As I can see, what is happening is that the Set of records are not loaded again when I do the rerender.

How I can reload the set of records? Is possible?

  • October 01, 2009
  • Like
  • 0
I am trying to call a Visualforce page from a custom list button.  I have done this successfully from a detail page button by creating a page using a standard controller for the detail object, selecting Visualforce page as the content source and then picking the page I wanted from the pull down list for content.
 
However, I can't seem to get this to work for a list button.  I pick the list button option on the custom button or link page, and pick visualforce page for the content source, but I don't get my visualforce page to appear in the content pull down list.
 
Is there something I'm doing wrong?
 
As an adjunct question, should I be using the standard controller for the detail object being displayed at the top of the page or for the objects being referenced in the list (in the case I'm working on now, the objects in the list are the same object as the detail object and reference back to the detail object)? 
 
I understand that one of the benefits of using a visualforce page in this manner is that the id for the detail object is automatically passed to the visualforce page, thereby making data display easier on the detail page.  If a visualforce page can be invoked from a list button, what object id is passed?  That of the detail item at the top of the page?
 
Thanks in advance for your help,
Jeff
 
  • January 16, 2009
  • Like
  • 0
I am trying to pull a field token back from a field schema map and use it in an SObject.
I do a describe call for all the fields in the SObject and then use a string value of the field name to get the field token back.

Apex compiler throws an error, Invalid field accField for SObject Account.
But the accField is a variable of type Schema.SObjectField and the map I use to set the variable is bring back the correct schema.
And the field does exist on the Account record.

Bottom line I trying to set a variable of type Schema.SObjectField with a valid account field. Can I do this in Apex?
  • October 28, 2008
  • Like
  • 0