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
hlee97hlee97 

Making standard fields required with red bar on a standard page layout

I'm trying to make the Lead address required on the page layout with the red bar in edit mode. We've done it with validation rules but we want the visual cue also. So far I've only been able to figure out how to make it required as a component but not in edit mode.

 

This is where I'm at with the code but it's not working correctly.

 

Is it even possible to make the address required on a standard page layout or do you have to rebuild the entire page? I'm just starting out with VF so any help would be appreciated.

 

 

<apex:page standardController="Lead">
<apex:form >
<apex:pageBlock title="Lead Edit" mode="edit">
    <apex:inputField value="{!Lead.Street}" required="true"/>
    <apex:inputField value="{!Lead.City}" required="true"/>
    <apex:inputField value="{!Lead.State}" required="true"/>
    <apex:inputField value="{!Lead.PostalCode}" required="true"/>
     <apex:inputField value="{!Lead.Country}" required="true"/>
</apex:pageBlock>
</apex:form>
</apex:page>

Suresh RaghuramSuresh Raghuram

you can make them red at the defination of the fields that is in the objects where the fields are defined. but make sure if that fields are used in some other requirement even it reflect over there.

 

 

If this answers your solution, make this as a solution.

hlee97hlee97

I'm not following your logic since this is a standard Lead page and I'm trying to avoid having to basically rewrite the entire lead page in visual force. I'm wondering if there is a solution to add a visualforce component to the standard lead page layout to make the fields required with a visual red bar.

Anuj12Anuj12

Did you figure out the solution to this..?? i have a similar scenario which i need to get done..

Nataliia Zhaglova 2Nataliia Zhaglova 2
Hi All, did anybody find a solution? I have the same scenario....Any ideas?
RbnRbn
Since Address is a standard Field, for the red mark visibility you have to go ahead in creating a  Visualforce page.

OR

You can create custom field of Address and make it as required while creating the fields.

If this answers your Question , make this as a solution.

Rgrds,
Rabi