You need to sign in to do that
Don't have an account?
VisualForce Error - Invalid CurrencyIsoCode for SObject CampaignMember
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):
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 -----------------
Ron, thanks so muh for the tip. My VS Page Version was 15.0 and my controller version was 20.0. I changed the VS version to 20.0 and the page now workes fine. I will have to remember to keep a closer look at the versions of my VS pages going forward.
michaleforce, i hope that this helps you also.
Cheers
Miguel =)
All Answers
I'm having a similar issue. Ever since the winter release I have a visualforce page that is giving the error "No such column CurrencyIsoCode on CampaignMember". But I am not querying or attempting to display the currency or any currency fields at all. Same as you, when I hide the campaign member fields it works fine... here is the very simple code:
Page:
Extension:
This is very frustrating because this is a critical page for us this time of year. I am going to forward this thread to salesforce premier support to see what they can do.
what is the version number on the class and page ?
Hey Ron, thanks for checking out the thread...
The page is 15.0
The class is 14.0
Ron, thanks so muh for the tip. My VS Page Version was 15.0 and my controller version was 20.0. I changed the VS version to 20.0 and the page now workes fine. I will have to remember to keep a closer look at the versions of my VS pages going forward.
michaleforce, i hope that this helps you also.
Cheers
Miguel =)
Yes... changing the version number of the page to 20 worked for me too... thanks Ron and thanks Miguel!