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
Pradeep VirkPradeep Virk 

How to hide a standard field?

Hi, If someone could help me on a way to hide a standard field in Accounts module?

 

Thanks,

Pradeep Virk.

Best Answer chosen by Admin (Salesforce Developers) 
CLKCLK

it's required on opportunity api, you can not remove it from anywhere.

If still this is ur requirement then there are 2 way to it.

1)you need to go for custom object.

2)if you still want persist with opportunity object then write before trigger for assigning some default value to stage field & then override new,edit,vied button with ur custom VF Page.

 

Easy way would be 1st one because just creating custom object,salesforce would give you all standard functionality & good part is that you don't any code for doing it.

All Answers

goabhigogoabhigo

Just remove it from page layout.

Some fields cannot be removed. The work-around is overriding with visualforce page. There is no other way I guess.

CLKCLK

it's depends on your requirement.

if you want make it disable for every user then make it disable for every profile from field level sevurity.

or if you want to disable for perticular detail page layout then just take that field out from that page layout.

Pradeep VirkPradeep Virk

Yes, it is a standard field that cannot be removed. Any idea where I should get started with Visualforce?

 

thanks,

Pradeep.

goabhigogoabhigo

The VF page will look something like the following:

 

<apex:page standardController="Accounts">
<apex:form >
<apex:sectionHeader subtitle="New Account" title="Account Edit"/>
<apex:pageBlock mode="edit" title="Account Edit">
<apex:pageBlockButtons >
<apex:commandButton action="{!save}" value="Save"/>
<apex:commandButton action="{!cancel}" value="Cancel"/>
</apex:pageBlockButtons>
<apex:pageBlockSection title="Accounts Details" collapsible="false">
<apex:inputField value="{!Your field 1}" required="true"/>
<apex:inputField value="{!Your field 2}" required="true"/>
...
...
</apex:pageBlockSection>
<apex:pageBlockSection title="xxxx">
...
...
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>

 

For more information on visualforce page:

http://wiki.developerforce.com/index.php/An_Introduction_to_Visualforce

http://www.salesforce.com/us/developer/docs/pages/index.htm

 

 

CLKCLK

Hi Pradeep,

 

Can u tell me which field you want to hide on account object?

CLKCLK

by my understanding, by creating VF Page you are not removing any fields from account object, it just that you are not giving access to that field to user and you can achieve the same by customising field level security to that object.

And i dont see any field to which we can't set field level security.

Pradeep VirkPradeep Virk

Thanks for helping out. Its the 'Stage' field.

CLKCLK

There is no stage field on Accounts object

Pradeep VirkPradeep Virk

Sorry, I meant the Opportunity module.

CLKCLK

it's required on opportunity api, you can not remove it from anywhere.

If still this is ur requirement then there are 2 way to it.

1)you need to go for custom object.

2)if you still want persist with opportunity object then write before trigger for assigning some default value to stage field & then override new,edit,vied button with ur custom VF Page.

 

Easy way would be 1st one because just creating custom object,salesforce would give you all standard functionality & good part is that you don't any code for doing it.

This was selected as the best answer
Pradeep VirkPradeep Virk

Thank you and appreciate your support.

Jitendra_CloudJitendra_Cloud

Hi,

We can hide standard fields from page layout.

Thanks & Regards,

Jitendra Tripathi

Salesforce Certified Developer