• migclark-dev
  • NEWBIE
  • 25 Points
  • Member since 2010

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

Hi,
Since the latest Winter release we have had trouble with one of our Visualforce pages that uses a custom Apex controller. The page displays a list of leads with the Most Recently Responded to Campaign Name and the Response Date.  See image below of what it used to look like (But with a Date in the Response Date column):

This image is not available because: You don’t have the privileges to see it, or it has been removed from the system

We are getting the following error on the page: 
     "Invalid CurrencyIsoCode for SObject CampaignMember"

If we hide the Campign Response Date column from the page, or use a different field then the page renders ok. It seems to only error when we are picking a field from the CampaignMember object.

Is someone able to help us?? I haven;t got a response from Salesforce yet and am rather perplexed about this error as we dont really use the Currency fields in our org, everything is in USD.
I have included the snippets of VS Page code and Apex Controller code that seem relevant.



------------- Start VisualForce Snippet -----------------
    <apex:pageBlockTable value="{!leads}" var="l" id="table">
        <apex:column >
            <apex:outputLink style="font-weight:bold" value="/{!l.Id}/e?retURL={!l.Id}"> Edit </apex:outputLink>                   
        </apex:column>
       
        <apex:column >
            <apex:facet name="header">Owner</apex:facet>
            <apex:outputLink value="/{!l.owner.Id}"> <apex:outputText value="{!l.owner.name}"/> </apex:outputLink>                   
        </apex:column>
        <apex:column >
            <apex:facet name="header">Rating</apex:facet>
            <apex:outputText value="{!l.rating}"/>           
        </apex:column>
        <apex:column >
            <apex:facet name="header">Status</apex:facet>
            <apex:outputText value="{!l.status}"/>                   
        </apex:column>
    
        <apex:column >       
            <apex:facet name="header">
            <!--     <apex:commandLink value="{!$ObjectType.Lead.Fields.Name.Label}" action="{!doSort}" rerender="theForm">
                    <apex:param name="sortField" value="Name" assignTo="{!sortField}"/>                           
                </apex:commandLink>  -->
                Name
            </apex:facet>
       
            <apex:outputLink value="/{!l.Id}"> <apex:outputText value="{!l.name}"/> </apex:outputLink>                   
        </apex:column>
                
        <apex:column width="200px" >
            <apex:facet name="header">Title</apex:facet>
            <apex:outputText value="{!l.title}"/>                  
        </apex:column>
        <apex:column width="200px" >
            <apex:facet name="header">Company</apex:facet>
            <apex:outputText value="{!l.company}"/>                   
        </apex:column>
        
     
        <apex:column >
            <apex:facet name="header">Campaign Most Recently Responded To</apex:facet>
            <apex:repeat value="{!l.CampaignMembers}" var="cm">
                <apex:outputField value="{!cm.Campaign.Name}"/>
            </apex:repeat>  
        </apex:column>
      
       <apex:column >
            <apex:facet name="header">Response Date</apex:facet>
            <apex:repeat value="{!l.CampaignMembers}" var="cm">
                <apex:outputField value="{!cm.FirstRespondedDate}"/>
            </apex:repeat>   
        </apex:column>

    </apex:pageBlockTable>

------------- End VisualForce Snippet -----------------



------------- Start Apex Controller Snippet -----------------
    public ApexPages.StandardSetController ssc {
        get {
            if(ssc == null) {
                if (userQuery == 'All') {
                    ssc = new ApexPages.StandardSetController(Database.getQueryLocator(
                        [SELECT id, name, status, owner.id, owner.name, rating, title, company,
                            (SELECT Campaign.name,Campaign.status, FirstRespondedDate,HasResponded FROM CampaignMembers
                               WHERE NOT FirstRespondedDate = null
                               ORDER BY FirstRespondedDate DESC
                               LIMIT 1)
                        FROM Lead
                        WHERE Owner.UserRole.Name like '%sales%' AND (Rating = 'A' OR Rating = 'B') AND IsConverted = false AND ( NOT ( Status = 'Nurture' OR Status = 'Unqualified' ) )
                        ORDER BY LastModifiedDate DESC]));
                }
                else { 
               
                    if (userQuery == '') {userQuery = UserInfo.getUserId();}
                     
                    ssc = new ApexPages.StandardSetController(Database.getQueryLocator(
                        [SELECT id, name, status, owner.id, owner.name, rating, title, company,
                            (SELECT Campaign.name,Campaign.status, FirstRespondedDate,HasResponded FROM CampaignMembers
                               WHERE NOT FirstRespondedDate = null
                               ORDER BY FirstRespondedDate DESC
                               LIMIT 1)
                        FROM Lead
                        WHERE owner.id =:userQuery AND (Rating = 'A' OR Rating = 'B') AND IsConverted = false AND ( NOT ( Status = 'Nurture' OR Status = 'Unqualified' ) )
                        ORDER BY LastModifiedDate DESC]));                   
                    }                                                     
                ssc.setPageSize(20);
            }
            return ssc;
        }
        set;
    }
   
    public List<Lead> getLeads() {
        leads = (List<Lead>) ssc.getRecords();
        return leads;
    }

------------- End Apex Controller Snippet -----------------

Hi,
Since the latest Winter release we have had trouble with one of our Visualforce pages that uses a custom Apex controller. The page displays a list of leads with the Most Recently Responded to Campaign Name and the Response Date.  See image below of what it used to look like (But with a Date in the Response Date column):

This image is not available because: You don’t have the privileges to see it, or it has been removed from the system

We are getting the following error on the page: 
     "Invalid CurrencyIsoCode for SObject CampaignMember"

If we hide the Campign Response Date column from the page, or use a different field then the page renders ok. It seems to only error when we are picking a field from the CampaignMember object.

Is someone able to help us?? I haven;t got a response from Salesforce yet and am rather perplexed about this error as we dont really use the Currency fields in our org, everything is in USD.
I have included the snippets of VS Page code and Apex Controller code that seem relevant.



------------- Start VisualForce Snippet -----------------
    <apex:pageBlockTable value="{!leads}" var="l" id="table">
        <apex:column >
            <apex:outputLink style="font-weight:bold" value="/{!l.Id}/e?retURL={!l.Id}"> Edit </apex:outputLink>                   
        </apex:column>
       
        <apex:column >
            <apex:facet name="header">Owner</apex:facet>
            <apex:outputLink value="/{!l.owner.Id}"> <apex:outputText value="{!l.owner.name}"/> </apex:outputLink>                   
        </apex:column>
        <apex:column >
            <apex:facet name="header">Rating</apex:facet>
            <apex:outputText value="{!l.rating}"/>           
        </apex:column>
        <apex:column >
            <apex:facet name="header">Status</apex:facet>
            <apex:outputText value="{!l.status}"/>                   
        </apex:column>
    
        <apex:column >       
            <apex:facet name="header">
            <!--     <apex:commandLink value="{!$ObjectType.Lead.Fields.Name.Label}" action="{!doSort}" rerender="theForm">
                    <apex:param name="sortField" value="Name" assignTo="{!sortField}"/>                           
                </apex:commandLink>  -->
                Name
            </apex:facet>
       
            <apex:outputLink value="/{!l.Id}"> <apex:outputText value="{!l.name}"/> </apex:outputLink>                   
        </apex:column>
                
        <apex:column width="200px" >
            <apex:facet name="header">Title</apex:facet>
            <apex:outputText value="{!l.title}"/>                  
        </apex:column>
        <apex:column width="200px" >
            <apex:facet name="header">Company</apex:facet>
            <apex:outputText value="{!l.company}"/>                   
        </apex:column>
        
     
        <apex:column >
            <apex:facet name="header">Campaign Most Recently Responded To</apex:facet>
            <apex:repeat value="{!l.CampaignMembers}" var="cm">
                <apex:outputField value="{!cm.Campaign.Name}"/>
            </apex:repeat>  
        </apex:column>
      
       <apex:column >
            <apex:facet name="header">Response Date</apex:facet>
            <apex:repeat value="{!l.CampaignMembers}" var="cm">
                <apex:outputField value="{!cm.FirstRespondedDate}"/>
            </apex:repeat>   
        </apex:column>

    </apex:pageBlockTable>

------------- End VisualForce Snippet -----------------



------------- Start Apex Controller Snippet -----------------
    public ApexPages.StandardSetController ssc {
        get {
            if(ssc == null) {
                if (userQuery == 'All') {
                    ssc = new ApexPages.StandardSetController(Database.getQueryLocator(
                        [SELECT id, name, status, owner.id, owner.name, rating, title, company,
                            (SELECT Campaign.name,Campaign.status, FirstRespondedDate,HasResponded FROM CampaignMembers
                               WHERE NOT FirstRespondedDate = null
                               ORDER BY FirstRespondedDate DESC
                               LIMIT 1)
                        FROM Lead
                        WHERE Owner.UserRole.Name like '%sales%' AND (Rating = 'A' OR Rating = 'B') AND IsConverted = false AND ( NOT ( Status = 'Nurture' OR Status = 'Unqualified' ) )
                        ORDER BY LastModifiedDate DESC]));
                }
                else { 
               
                    if (userQuery == '') {userQuery = UserInfo.getUserId();}
                     
                    ssc = new ApexPages.StandardSetController(Database.getQueryLocator(
                        [SELECT id, name, status, owner.id, owner.name, rating, title, company,
                            (SELECT Campaign.name,Campaign.status, FirstRespondedDate,HasResponded FROM CampaignMembers
                               WHERE NOT FirstRespondedDate = null
                               ORDER BY FirstRespondedDate DESC
                               LIMIT 1)
                        FROM Lead
                        WHERE owner.id =:userQuery AND (Rating = 'A' OR Rating = 'B') AND IsConverted = false AND ( NOT ( Status = 'Nurture' OR Status = 'Unqualified' ) )
                        ORDER BY LastModifiedDate DESC]));                   
                    }                                                     
                ssc.setPageSize(20);
            }
            return ssc;
        }
        set;
    }
   
    public List<Lead> getLeads() {
        leads = (List<Lead>) ssc.getRecords();
        return leads;
    }

------------- End Apex Controller Snippet -----------------