Increase the Number of Custom Fields - Answers - Salesforce Trailblazer Community
Trailblazer Community
Ask Search:
Lahiru SubasingheLahiru Subasinghe 

Increase the Number of Custom Fields

Hi All,

Is there any way that we can increase the custom fields per object? As my understanding theres only 500 custom fields per a custom object.
I have come across a scenario that I couldn't save a record when the custom fields exeeds more than 70%.

Is there any way to overcome this issue?

Thanks,
Mudiyanse

Neha LundNeha Lund
I guess you are unable to save the record since it exceeds your storage capacity
Sharif ShaalanSharif Shaalan
What is the error msg?
Lahiru SubasingheLahiru Subasinghe
Thanks for the quick response.

Theres no error messages, but can not save the record once it exceeds more 70%. Once I remove fields (<70%) then I was able to save it.

Can we overcome this issue by increasing the default number of fields?

Thanks,
Mudiyanse
Jeff MayJeff May
What do you mean can't save the record?  When you create a New record and enter the required fields and press Save, what happens?
Lahiru SubasingheLahiru Subasinghe
It will redirect to the edit mode with view state. The new record hasn't been created/Saved. Once I removed fields I was able to Create/Edit the record and successfully save them (Values will be stored in database)
Jeff MayJeff May
Are you writing a custom VF page?
Lahiru SubasingheLahiru Subasinghe
Yes I have a VF page. Can there be any impacts from that?
Jeff MayJeff May
Yes there is -- The VisualForce ViewState has limits -- your VF page cannot exceed those limits.   You will have to find ways to reduce the view state of the page -- it has nothing to do with how many fields are on the record.   Here is a link that describes the ViewState.   http://wiki.developerforce.com/page/An_Introduction_to_Visualforce_View_State
Dharani PothulaDharani Pothula
+1 @Jeff,  it is a good practice to use transient keyword in the apex controller which references VF page , since it will not count towards your view state limit.

Thanks,
Dharani
Lahiru SubasingheLahiru Subasinghe
Thanks Jeff,
I will take necessary actions for the view state issue.

Anyway in general is there any way to increase the custom fields for custom object? Because I need to add more than 500 custom fields in one of my custom objects.

Thanks,
Mudiyanse
Dharani PothulaDharani Pothula
Mudiyanse,

You have to contact salesforce for this.

One way you can do this is , you can have a master-detail or look up related object and have certain related fields on this objects. That way you can overcome the limitation on fields.

Thanks,
Dharani
Lahiru SubasingheLahiru Subasinghe
Hi All,

Just looping back to my original question.

Actually I checked the size of the view state of my VF page. It doesn't exceed at least 10Kb. As per my understanding we can have up to 135Kb for VF page.
Just curious that what might have gone wrong here.

Mudiyanse.