function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Rajat MahajanRajat Mahajan 

To delete columns from user interface (pageblocktable) without changin code

Hi All,

 

I have a requirement where an admin user can delete the columns from a pageblocktable on the ui, without changing the code.

 

The admin user should be able to do this from the user interface.

 

Could you please tell me if this is feasible and how ?

 

Thanks in advance

Best Answer chosen by Admin (Salesforce Developers) 
Ankit AroraAnkit Arora

There are many work around for this. If you want user to change the column order, delete any column etc.. you can do this using EXTJS grid. But preference will not be saved for the next time. If you want to save the settings then you need to Handel it with Apex controller.

 

Create a custom setting where you will maintain the column for the table, now user can delete any column or add any column using those custom settings. You just need to pick the column values from that custom settings.

 

Thanks

Ankit Arora

Blog | Facebook | Blog Page

All Answers

Ankit AroraAnkit Arora

There are many work around for this. If you want user to change the column order, delete any column etc.. you can do this using EXTJS grid. But preference will not be saved for the next time. If you want to save the settings then you need to Handel it with Apex controller.

 

Create a custom setting where you will maintain the column for the table, now user can delete any column or add any column using those custom settings. You just need to pick the column values from that custom settings.

 

Thanks

Ankit Arora

Blog | Facebook | Blog Page

This was selected as the best answer
Rajat MahajanRajat Mahajan

Hi Ankit,

 

Thanks for the solution, i am proceeding by making a custom setting object. And adding a customize column button on the page.

 

I will add or remove columns according to that.

 

Thanks :)

Ankit AroraAnkit Arora

You can also use custom object to achieve this.

 

Thanks

Ankit Arora

Blog | Facebook | Blog Page

venu kingvenu king

Hi

 

Can You Provide sample example Me To facing same Pbrlm 

 

 

 

Thank You 

 

Venu Kalluru