Cannot create trigger on custom object

Issue #793 resolved
Alexander Johannes created an issue

It is not possible to create a trigger on a custom object.

Prerequisites

DevOrg with namespace and managed package. Package is managed released (not beta). Custom object is also released.

Steps to repeat

  • open new apex trigger wizard in IC
  • select custom object
  • select After Update
  • confirm with OK

Expected

Trigger is deployed to Salesforce

Actual

Trigger cannot be deployed with the following error message:

Deployment Failed: INVALID_ARGUMENT_TYPE - Invalid object or access for CustomObject__c on field [TableEnumOrId]

Note that the namespace prefix is missing from the object type in the error message.

Comments (10)

  1. Alexander Johannes reporter

    When i create the trigger in the Salesforce webinterface, i can update and save it in IC without any issues afterwards.

  2. Scott Wells repo owner

    Thanks for reporting, Alexander. Let me take a look and see if I can reproduce this. Is it consistently reproducible for you? I'm pretty sure I created a new trigger on custom object via IC just this week with no problem. Also, if you can reproduce it, does the same behavior occur if you switch to the Metadata API? You can do so by unchecking Prefer Tooling API for>Apex in Illuminated Cloud>Configure Application>Validation & Deployment.

  3. Alexander Johannes reporter

    This can be reproduced in two different projects. Standard objects are not affected. When i disable the tooling API, the trigger can be deployed without the error message.

  4. Scott Wells repo owner

    Okay, that helps. This is a bug I've reported to Salesforce with metadata creation via the Tooling API. I may just take out Tooling API-based metadata creation for now given that it seems to be causing issues for folks. Thanks for confirming!

  5. Jeff May

    As a note -- if I switch to NOT Prefer Tooling API (which then uses the Metadata API) I can deploy as expected.

  6. Scott Wells repo owner

    Yep, it's a bug on the Salesforce side. As I mentioned, I may just route all Apex file creation to occur through the Metadata API until Salesforce fixes this.

  7. Scott Wells repo owner

    Delivered in 2.0.0.2. I will also be updating IC1 with the fix tomorrow morning and will keep this open until I do so.

  8. Log in to comment