1

I am trying to create an APEX Trigger that strips a custom field of any HTML. I wrote this code in a Trailblazer sandbox and it was working fine. When I moved it over to my Dev org I now am getting an error message when saving:

Failed to create createContainerMember for containerId=1bg8X000000HkYgQAK: SELECT Id FROM ContainerAsyncRequest WHERE State ^ ERROR at Row:1:Column:16 sObject type 'ContainerAsyncRequest' 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.

Here is the APEX Trigger I am trying to write:

trigger removeHTML on Case (before update) {
    for (Case c : Trigger.New){
    c.MyCustom_Field__c = c.MyCustom_Field__c.stripHtmlTags();
    }
}

Currently I have made sure that my profile has:

  • API Enabled
  • View and Setup Configuration
  • View All Data
  • Write access to MyCustom_Field__c and Case

I have changed my Developer Console Workspace in case it had gotten corrupted.

Even when all I do is create the trigger and then try to change insert to update I can't save.

trigger removeHTML on Case (before *update*) {

}

Any ideas on what to try next?

3
  • Opening a case with Salesforce support wouldn't be a bad place to start.
    – Adrian Larson
    Dec 14, 2021 at 15:40
  • How many workspaces do you have in dev console? You mentioned changing it but I'd recommend deleting any extras so there's only one. Likewise, you could look at querying ApexClassMember and MetadataContainer through tooling api and deleting the rows (warning: you'll lose any in progress apex work that isn't saved to the org). This is probably a good time to plug using VS Code over dev console as well. Dec 14, 2021 at 16:18
  • @KrisGoncalves I would love to use VS Code but I am not allowed. I did delete all other workspaces. Dec 14, 2021 at 17:07

0

You must log in to answer this question.

Browse other questions tagged .