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
sg88324sg88324 

Dynamic enabling of sections

Hi,

 

Can anyone tel me if there is a way to enable a section depending on a checkbox value without using visualforce?

 

Thanks,

Sandeep

 

 

Best Answer chosen by Admin (Salesforce Developers) 
SurekaSureka

Hi,

 

If you are using page block section, then try with like the below code:

 

For eg. If IsCustomerPortal is the Checkbox field, then

 

<apex:pageblocksection title="abc" rendered="{!Account.IsCustomerPortal}">

 

Hope this helps. If so, Please mark the solution as solved.

 

Thanks

 

All Answers

SurekaSureka

Hi,

 

If you are using page block section, then try with like the below code:

 

For eg. If IsCustomerPortal is the Checkbox field, then

 

<apex:pageblocksection title="abc" rendered="{!Account.IsCustomerPortal}">

 

Hope this helps. If so, Please mark the solution as solved.

 

Thanks

 

This was selected as the best answer
sg88324sg88324

Hi Sureka,

 

Thanks for replyin...actually we dont wanna use visualforce here...instead we need the funtonality through configurations. I came to know that the dynamic enabling of sections has been a very well promoted idea but i donno if salesforce guys have come up with a solution for it yet.

 

Thanks,

Sandeep

Ispita_NavatarIspita_Navatar

Actually the dynamic showing and hiding of sections cannot be done in standard pages that is via configurations.

you are rite that it is a very widely promoted idea but still it is not available via configurations but as Sureka has pointed out salesforce has made the alternate path via visual force to fill up the gap.

sg88324sg88324

Thanks ispita fr posting. we hav used visualforce fr the required funtionality nw cos we ve got no other alternative.

hope salesforce guys wud come up with the functionality through configurations :)

Ispita_NavatarIspita_Navatar

 You can probably write salesforce about this and also keeps voting for the idea , so that salesforce thinks about rolling it out in their next release.

sg88324sg88324

yeah u r right

ImaghrooriImaghroori

You can, for very simple use cases.

 

For example, let's say when a "Owns a home" checkbox is checked on a lead, the "home owner" fields are displayed.

 

Create two record types (Owns a home, rents), with two page layouts respectively.

 

Put the "owns a home" checkbox on both page layouts. Put the "Home owner" fields ("Mortgage","PMI","HOA", etc.) only on the "Owns a home" page layout.

 

Create two workflow rulesOne for when the checkbox is checked, one for whent it's uncheckedWhen it's checked, change the record type from "Rents" to "Owns Home".  This will automatically change the page layout, so once the record is saved, the next time it refreshes the new fields show up.

 

The other workflow rule does the same thing in reverse. If the checkbox is unchecked, switch the recordtype back to "rents'.

 

This won't work for complex use cases... unless you want to have a LOT of permutations in your Page Layouts / Record Types.

 

It's time intensive, but it works.