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
bikerdan76bikerdan76 

Possible SalesForce.com Bug?

First off, please read the WHOLE message before replying.  Everyone seems to read the error message and stop there...  Thanks. :)

 

So I came across this error when doing something relatively simple and after narrowing it down, it seems to be a problem with SalesForce itsself.  First the error:

 

SELECT id FROM Lead WHERE ((CampaignId = '701xxxxxxxxxxxxx') ^ ERROR at Row:1:Column:29 No such column 'CampaignId' on entity 'Lead'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.

 

 

Here's how to reproduce it. 

 

 Apex Page: 

 

 

<apex:page standardController="Lead" extensions="leadsextension" recordSetVar="leads" id="leadslist"></apex:page>

 

Apex Class (leadsextension.cls):

 

 

public class leadsextension{ private List<Lead> leads; public Integer leadsCount { get; private set; } public leadsextension( ApexPages.Standardsetcontroller stdSetCtrlr ) { leads = (List<Lead>)stdSetCtrlr.getSelected(); } }

 

Add the page as a custom button to the leads list view, check some leads and click the button.  Everything so far works fine.  Now the problem.  Create a lead view with a campaign as a filter.  Load that list, check some leads and click the new button... ERROR!  Maybe I'm being stupid and someone can lead me out of the darkness.  Help!

 

Thanks,
Dan

Message Edited by bikerdan2112 on 01-04-2010 01:15 PM
Message Edited by bikerdan2112 on 01-04-2010 04:49 PM
BritishBoyinDCBritishBoyinDC
I think you are mixing up the CampaignId value that you can set via Web2Lead with the standard relationship between Leads and Campaigns. When you use Web2Lead or load Leads via the UI, you can indeed set a CampaignId. But as far as I know, when you are querying via Apex, no such relationship exists - Leads are actually related to Campaigns in a many - many relationship via the CampaignMember table - so you would need to search that table and set the query to use CampaignId (which is a field on CampaignMember)...
bikerdan76bikerdan76
I'm not sure your answer applies to my problem...  What does Web2Lead have to do with this.  Maybe I missunderstand your answer.  The problem can be produced on a brand new developer system with generic data.  The code you see in my prior post is the ONLY code you need to reproduce this.  I am not running the query in the error message.  The query is being run by Salesforce in the default controller.   Thanks for your reply.  I'm very grateful for your time.
BritishBoyinDCBritishBoyinDC

Ah, sorry - I see what you mean - that may indeed be a bug with the Lead Set Controller. I'm pretty sure you can't query directly for CampaignId on the Lead table in Apex, but that's what it appears to be trying to do (there is some specialized functions that let you do that in the UI, but I don't believe they are available in Apex, which might be why you're getting that bug) - I'd raise a case, but in the mean time, you'll probably need to change the extension to query for the leads in the CampaignMember table...

 

 

jkucerajkucera

CampaignID cannot be accessed on Lead as it's not a true field in the schema in the usual sense.  Query CampaignMember instead to get what you're looking for.

 

Here's more details from a previous post:

http://community.salesforce.com/sforce/board/message?board.id=apex&message.id=24019

bikerdan76bikerdan76
I must not have written my post very well because everyone thinks that I'M trying to query the campaignId... I'm not.  The only time it happens is when the customer uses a list that is filtering off of the campaign.  Querying using the CampaignMember stuff will not work because I have no idea that the customer is using a list filtered on that criteria.  I realize that not knowing the reason behind what I'm doing is not helpful in giving me a workaround.  Otherwise it works just fine.  I'll submit a case and see where it goes from here.  If anyone else has any ideas, please let me know.  Thanks again for all of your time.
jkucerajkucera

Are you trying to create a custom button using a list controller on Lead that accesses the CampaignID in the List view filter criteria?

 

If so, I'm pretty sure that the list criteria aren't available in Apex as I'm not even sure they are exposed in the metadata API.

bikerdan76bikerdan76

I am trying to create a custom button using a list controller, but not that accesses the campaignId in the list view criteria.  Apparently, Salesforce is doing something on the backend that is trying to re-apply the list view filter criteria...   Thanks for continuing to help out.

jkucerajkucera

Thanks for the clarification - looks like this might be a bug where the criteria is loaded incorrectly, creating the error. 

 

If you haven't already, file a ticket with support and it should be escalated to my team shortly.  In the meantime, we'll look into a root cause & fix.

bikerdan76bikerdan76

You guys are awesome.  Thanks for taking the time to look into my issue.  I have created a ticket.  Case # 03200735.  It looks like it was last modified by Diego Olarte.  Again, thanks for all of your help.

bikerdan76bikerdan76

Here is the final result of the correspondence with support on this issue.  They have admitted that it is a bug in their system and that the fix will be "targeted for a future patch or seasonal release", which really blows because this application is soon to be posted on Appexchange and there will be lots of SalesForce customers having this issue.  Do you guys know of any way to get this pushed through faster?

 

Thanks,
Dan

jkucerajkucera

Sorry for the delay here.  My team's been investigating this for some time now as we didn't want to wait for case escalation to get a solution in the works.

 

On the high level, we know exactly what the problem is, but the fix is hard so it may take some time.  We're working with another team to iron out the details to make sure the cure isn't worse than the bug.

sfdcdev.ax551sfdcdev.ax551

Hi John,

 

Is there a workaround for this issue?

 

Thanks and regards,

Ambili

jkucerajkucera

The error surfaces only for Lead list views filtering on a specific campaign so the best workaround I can recommend is avoiding lead list views that filter on campaigns. 

 

Other than that, I can't think of a good workaround as campaign member list controllers aren't available until we enable campaign member list views, which is very high on the marketing roadmap right now.

sfdcdev.ax551sfdcdev.ax551

Hi John,

 

Thanks. Strangely we are not getting this error since past few minutes. Do you know if any patch has been applied to fix it? This was not working since 1/5 until a few minutes ago.

 

Is anyone else still getting the error or is it resolved?

 

Thanks

Message Edited by sfdcdev on 01-12-2010 03:55 PM
bikerdan76bikerdan76

I just tried it again in one of our customer's systems and the problem is still happening.  The best solution that I can come up with to my particular issue is to pass the list of selected records to the controller through Javascript.  The only limitation with this is I cannot let them operate on an entire list without checking all of the options.

 

Thanks for your continuing efforts.

 

Dan

bikerdan76bikerdan76
Any update on this?
bikerdan76bikerdan76
Bump
jkucerajkucera
Unfortunately I don't have updated timing for this as the fix lies with another team who hasn't yet prioritized it.  Worst case, mid June my team is planning to release list views for campagin member (safe harbor), which would allow list controllers of lead data filtered by campaign.
bikerdan76bikerdan76
Thanks for the follow up.
Seema ASeema A

Any updates on this issue ? Because i am still facing the same issue.

greenstorkgreenstork

I am running into this issue as well.  I am attempting to use the getSelected method from a controller extension to retrieve a list of sObjects selected in a list view.  When using the Campaign filter in the list view on Contact (not Lead), I am getting this error on load of my Visualforce page which calls getSelected from the constructor:

 

system.security.NoAccessException: Object type not accessible. Please check permissions and make sure the object is not in development mode: SELECT id FROM Contact WHERE ((CampaignId = '70160000000BBqR') ^ ERROR at Row:1:Column:32 No such column 'CampaignId' on entity 'Contact'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.

 

To be clear, like the original author of this thread, I am not querying for CampaignId, I am not using a SOQL at all in my controller extension.  The only method that is causing some behind the scenes query to take place is getSelected().

 

Should I open a case? I'm quite discouraged to see that this has been a known problem for over a year.  I'd love at least a workaround.

 

Thanks,

Dave