0

I'm getting below error message while I add comments for code.

Failed to create createContainerMember for containerId=1dc1w000000RKpEAAW: Body: data value too large: /
* Copyright (c), FinancialForce.com, inc
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* - Neither the name of the FinancialForce.com, inc nor the names of its contributors
* may be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/

//Patched by MetadataServicePatcher v38.0 2017-01-12 00:00:00

//Generated by wsdl2apex

public class MetadataService {
public class ReportTypeColumnTranslation {
public String label;
public String name;
private String[] label_type_info = new String[]{'label','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'};
private String[]... (max length=1000...

I don't understand why it is throwing the error message, Any help is appreciated.

2
  • Have you tried to add comment without using the Developer console? Go to Setup->Develop->Apex class-><apex class name> and edit it.
    – summer
    Dec 26, 2019 at 11:35
  • Yes, I was using developer console.
    – user77394
    Dec 26, 2019 at 11:40

1 Answer 1

3

This is a limitation of the developer console, similar to what I described in What is the longest URI that Salesforce will accept through the REST API?

In short, the developer console is sending the code you have in your dev console's execute anonymous window to a REST endpoint as a query string parameter, and Salesforce can only handle URLs that are somewhere around 16k characters.

Your additional comments pushed you over that.

The use case you're describing sounds more like you should be adding the class into your org, rather than trying to execute it anonymously.

You must log in to answer this question.

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