2

I have been getting below error when trying to deploy new changes from sandbox to production.

chatter_answers_question_escalation_to_case_trigger: trigger body is invalid and failed recompilation: Entity is not org-accessible Stack Trace: null

This is a trigger on Question (chatter Question) object which I can't find it after summer 16 release. Last successful deployment was on 06/09 and only change we did since yesterday was recompiled all classes and ran All tests.

Any help is greatly appreciated.

2
  • 1
    well, the error Entity is not org accessible doesn't mean that Question is the problem as that SObject is documented to be in V37.0. But if the trigger refers to any sobject or sobjectfield that was introduced in V37 and your prod org is still at v36, then this error could occur if your sandbox was at v37.
    – cropredy
    Commented Jun 11, 2016 at 0:55
  • I tried commenting out the code and deployed but still got same error. My production org and sandbox orgs are at V37. Also, i am getting below error when I tried to access Question object in developer console but not in one of the sandboxes which is at V36. ** SELECT Id from Question**. SELECT Id from Question ^ ERROR at Row:1:Column:16 sObject type 'Question' is not supported. If you are attempting to use a custom object, be sure to append the '__c' after the entity name. Please reference your WSDL or the describe call for the appropriate names. Commented Jun 11, 2016 at 3:24

6 Answers 6

2

I'm going to surmise that Chatter Questions is not enabled in your PROD org. Per Help doc:

To enable Chatter Questions in your organization, add the Question action to the global publisher layout. If your organization was created after Summer ‘14, the Question action is automatically added, but we recommend dragging it to the far left to increase its visibility. If you’re using a customized publisher layout in groups or on records, make sure that the Question action is added to those layouts as well.

1
  • I went through this earlier (before i posted the problem) but didn't help. Commented Jun 13, 2016 at 3:58
1

Do do have Chatter Answers enabled for the production. This can be cause of the issue! You should log a case with support to get it enabled.

1

I had the same issue, Since we do not use chatter answers I deleted the chatter_answers_question_escalation_to_case_trigger from production using workbench to deploy the following meta data and checking the Ignore Warnings checkbox.

package.xml:

<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
    <version>37.0</version>
</Package>

destructiveChanges.xml:

<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
    <members>chatter_answers_question_escalation_to_case_trigger</members>
    <name>ApexTrigger</name>
</types>
<version>37.0</version>
</Package>

Hope this helps you deploy change sets in the mean time.

1
  • I have tried this but our org has <75% code coverage and if i provide test class name ChatterAnswersEscalationTriggerTest during the deployment, it gives below error. ChatterAnswersEscalationTriggerTest line 17, column 13: No such column 'CommunityId' on entity 'Case'. 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. Stack Trace: null Commented Jun 20, 2016 at 22:41
1

here is an additional thing that may help you.

I was using a brand new Salesforce Production Instance build on Spring 17.

When I started the deployment into Production instance, I bumped into the above error.

ChatterAnswersEscalationTriggerTest line 17, column 13: No such column 'CommunityId' on entity 'Case'. 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. Stack Trace: null

chatter_answers_question_escalation_to_case_trigger: trigger body is invalid and failed recompilation: Entity is not org-accessible Stack Trace: null

As I had done during my Sandbox deployment, I uploaded the package to delete the Trigger and Apex Class that caused these 2 issues.

With very little trouble I deployed it into Sandbox as it did not demand me the code coverage.

When I did the same in Prod, as these where Apex Deployment, it required me to have a code Coverage of 75% instead of 0%. In order to get around the problem, not sure if that is the best option, I wrote a dummy Apex Class and a supporting test class, had few method built up with around 300 lines of code that was covered on running the test class.

Once tested in Sandbox, I deployed the same in Production and bingo it worked like a charm.

here is the update package.xml where InitialCodeCoverage and InitialCodeCoverage_UT are the dummy apex classes I wrote for code coverage.

<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
    <types>
        <members>ChatterAnswersEscalationTriggerTest</members>
        <members>InitialCodeCoverage</members>
        <members>InitialCodeCoverage_UT</members>
        <name>ApexClass</name>
    </types>
    <types>           <members>chatter_answers_question_escalation_to_case_trigger</members>
        <name>ApexTrigger</name>
    </types>
    <version>37.0</version>
</Package>

When I deployed my actual package, I marked these files as deleted thus making sure it does not interfere in my future code coverage.

0

I believe the reason you're having this problem is that the Question Object changed with the Summer 16 release. The API 37 version of Question is not the same as the API 36 version of Question object. Your trigger is trying to reference one API's version, but finding a different version which it isn't recognizing.

On the surface it would appear there wouldn't be a difference, but I happened to have the SP16 Object Reference in PDF format and compared it to the SU16 Object Reference for Question in the latest docs. I found an unusual reference in the BestReplySelectedById field in SP16 version compared to SU16 which is as follows:

Description

The ID of the User who selected the best answer to the question. This field is available in API version 24.0 and later. In API version 24.0 through version 29.0, you must update this field using the UI. In API version 36.0 and later, you can update this field using the API.

What's interesting is that in the SU17 version, for the same field, it has this:

Description

The ID of the User who selected the best answer to the question. This field is available in API version 24.0 and later. In API version 24.0 through version 29.0, you must update this field using the UI. In API version 37.0 and later, you can update this field using the API.

What the above says to me, is that Salesforce changed the BestReplySelectedById field both in SP16 and SU16! The API version of the Question object is likely creating the issue you're having. If I understand what you've described correctly, what you need to do to solve your problem is deploy the API 37 Question Object to your org along with your API 37 trigger for you to be able to deploy it and have it work with your production org. It's likely they're not at the same API version.

You may also want to look at the SU16 Release Notes regarding the numerous changes that came up related to Chatter Questions.

8
  • Thank you!. I tried below and got two errors. Updated version of this trigger to 37 in sandbox (which is on SU16 like production) and tried to deploy this trigger along with Question object through eclipse. Error 1)Entity is not org-accessible (this is on Trigger) 2) Invalid fullName, must end in a custom suffix ( for ex. __c ) - (Question Object). My concern is, why it just came up without any changes made to this object/trigger in our org? If this is because of salesforce version release/change, then i assume this must be happening for all users/orgs on SU16 across the globe. Commented Jun 12, 2016 at 20:38
  • One interesting point is, in the quick find setup search, if I type Question, i see this object in sandboxes but i don't see the same in production. Am i missing something here (like access permissions..) ? I am an Admin though. Commented Jun 12, 2016 at 20:38
  • I'd recommend you check using Workbench in both your Sandbox and Production Orgs. I'd also recommend you check your setup history logs to see if you've done something to disable chatter questions in your org since it was previously working.
    – crmprogdev
    Commented Jun 13, 2016 at 0:01
  • 1
    Workbench shows Question object for Sandboxes but not for production. NO clue in setup history. I have logged a CASE with Salesforce, I will let you know the outcome. Thank you very much !! Commented Jun 13, 2016 at 3:56
  • 1
    I heard back from Salesforce support and apparently it seems to be production bug introduced by disabling Chatter Answers feature licenses on June 10th 12:01 am EST with Summer16 release. I was told that there are more CASES opened for the same issue by multiple customers in this week. While they can't issue Chatter Answers feature license which would fix this immediately, they are working on releasing a fix (as I was told by customer support rep). This will continue to work in sandboxes unless we refreshed after June 10th. Commented Jun 18, 2016 at 5:32
0

For the chatter_answers_question_escalation_to_case_trigger, i'm not able to delete it via workbench also. I'm lacking coverage when I'm not running all the local test classes. When running all, The chatter trigger test class is generating error. I don't believe salesforce is letting a big BUG like this.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .