You need to sign in to do that
Don't have an account?
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?
Here's an updated package.
https://login.salesforce.com/?startURL=%2Fpackaging%2FinstallPackage.apexp%3Fp0%3D04t900000000fq7
All Answers
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.
Jim:
Thanks for your help. That could indeed be the problem as the api for the app is 14.0.
Thanks for the tip.
Working on this. Can you post a screenshot of where the error is so I can reproduce it?
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!
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.
Here's an updated package.
https://login.salesforce.com/?startURL=%2Fpackaging%2FinstallPackage.apexp%3Fp0%3D04t900000000fq7
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".
Same here!