+ Start a Discussion

"SOQL statements can not be longer than 10000 characters"---URGENT

Hi All,

    I am facing a governer limit issue. Can any body provide me point to point quick solution.


Issue:- I have one visualforce page where I am using standard controller to take the input from the user.

              The number of fields are supposed to be 700.


It works fine wih 352 fields as of now but when I increase the number of fields on the VF page it throws



Error: ; nested exception is: common.exception.ApiException: SOQL statements can not be longer than 10000 characters.

<script type="text/javascript">//

// <![CDATA[ var tabId = getCookie('dmTab'); var closeButtonId = 'thePage:theForm:closeButton'; if (tabId && getBottomPanelHeight() > 28) { showCloseButton(closeButtonId, true); } else { showCloseButton(closeButtonId, false); } document.getElementById('thePage:theForm:controllerTab').style.display = (false) ? 'inline' : 'none'; //




It is very urgent for me.


Query 1:- How many fields one object can have at the max?

Query 2:- Assuming if an object can have maximum 400 fields then how the reamining 300 fields can be accomadated

                in the same visualforce page.


Awaiting response








Await a response no longer!


Q1: Your problem isn't the number of fields, it's the length of the SOQL generated using all of your fields. The more characters in your field names the shorter your query has to be (in this case). The answer to your questions depends on some factors, the answer can be found here: https://na1.salesforce.com/help/doc/en/limits.htm


Q2: Create a wizard i.e. a n-step wizard with each page containing information that can be logically grouped together. You'll probably want a controller extension to help your Standard Controller.




Thank you very much for quikc reply.


I have understood, total permissaible number of fields are 500 but my question is why I am not able to process all

500 fields using standard controller on the VF page.


is it becasue the length of API name of the fields are more?

If I reduce the API length to 7 charcters then will I be able to process all 500 in One VF page?


and hat about the other 200 fields?

If craete one extensn and process remaining fields on the same page then will it work because I can not create

multiple wizard. There has to be One big VF page only.


Please reply.





The exception is saying that the SOQL query running in the standard controller is too long so yes, the API field name length does affect the query length.


I'm not sure if there's a limit on the number of fields you can fetch too. 


I don't know what you're going to do with the extra 200 fields, I would argue that an object with more than 100 or 200 fields needs to be normalised into a different object-design. You're going to have problems all along the way with so many fields on one object and one page.


is there any messenger kind of thing like G-TALK, where all salesforce expert discuss??


I am searching for common platform from long but still not sure?


If something is there then do let me know and also guide me step step by configuration process(if any )

how to initiate a talk dynamically? how to add users? how can i see the user online?





The forums are one place, but you can increase visibility by posting a link to this forum post to twitter using the #askforce hashtag.




Are you really expecting your users to enter 700 fields in one page?  That seems like a very bad UI design.   You really need some kind of multi-step wizard (that saves as you go along, so if there is a network problem of the user makes a mistake, they don't lose all their work...)