function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
RatherGeekyRatherGeeky 

Adding CurrencyIsoCode to Query to prevent error in Force.com Labs App Campaign Membership Manager

I'm using the Campaign Membership Manager 1.0 app by Force.com Labs. Unfortunately, it seems that having mutli-currency enabled is causing a problem with the code. 

 

Invalid field CurrencyIsoCode for SObject CampaignMember 

 

I attempted to resolve this problem myself by updating the query in the app controller by adding the CurrencyIsoCode to both the CampaignMember and Campaign queries. But, I get this error when I try to save in Eclipse:

 

No such column 'CurrencyIsoCode' on entity 'CampaignMember'.

 

I have double checked the spelling and actually copied the api name from the Setup > Campaign Members field listing. So, I know that it exists on the CampaignMember object. I'm just confused as to why it won't let me include that field.

 

It's pretty pointless because we aren't using the Multi-Currency field. We enabled it in the past because a consultant told us to but we are only using dollars.

 

Here is the query that I am updating:

 

 

        for( CampaignMember cm: [ Select Id, CurrencyIsoCode, LeadId, Lead.Company, Lead.Email, Lead.FirstName, Lead.LastName, Lead.OwnerId, Lead.City, ContactId, 
        							Contact.Account.Name, Contact.Email, Contact.FirstName, Contact.LastName, Contact.OwnerId, Contact.MailingCity, Status
        							from CampaignMember 
        							WHERE CampaignId =: selectedCampaign AND ( Contact.OwnerID =: userName OR Lead.OwnerID =: userName ) 
        							ORDER BY Lead.LastName, Contact.LastName ] ){
        								
            this.campaignMemberList.add( new MyCampaignMember( cm ) );
        }
        

 

Any tips as to why this may be happening or how I can reformat the query?

 

Best Answer chosen by Admin (Salesforce Developers) 

All Answers

JimRaeJimRae

I would check and see what API version the code for that app is.  If it is an early version, it may not have supported the CurrencyISOCode field.

RatherGeekyRatherGeeky

Jim:

 

Thanks for your help. That could indeed be the problem as the api for the app is 14.0.

 

Thanks for the tip.

ReidCReidC

Working on this.  Can you post a screenshot of where the error is so I can reproduce it?

RatherGeekyRatherGeeky

Yep, here's a few screenshots: http://screensteps.me/jbaze/dh3q23

 

Let me know if I can provide anything else to help. This would be a great, great, great tool for us!

ReidCReidC

Jim is correct.  If you update the version of CMM apex classes to 21 and update the VF page to 21, you do not get this error.

 

Updating is easy.

 

setup > develop > apex classes > edit near the "cmm" apex classes

 

Click on the "version" tab.

 

Change the drop down to "21".

 

Repeat for the VF page.

MaryPMaryP

Looks promising! I downloaded the new package and I think I am missing something. I have permission for the VF page and Apex Classes, but when I choose a campaign which I know has members, I get the description of the campaign and a message saying "CMM_No_data_available" and there is no listing of the members. Are there particular requirements for the campaign? It is set to Active and status is "planned".

JuulJuul

Same here! 

 

CMM_No_dataCMM_No_Campaign