+ Start a Discussion
Sapana WSapana W 

Change the 'New' and 'Edit' mode for a record

I have an object say A containing 15 fields , when  I add a new record to object A only 10 fields out of 15 should be visible and I must be able to enter values into it and save the record.Now after I open this saved record ,all the 15 fields should be visible to me and I should be able to enter values into it.

              Is this possible using standard functionality of salesforce and how?If not how can it be done using  Visualforce page?

Best Answer chosen by Admin (Salesforce Developers) 
SteveBowerSteveBower

Could you set up the default record type for new records to be record type A which has an associated page layout which only shows 10 fields.

Then, create a workflow rule which only fires on record creation.  That rule does a field update to change the record to record type B which has a different associated page layout which shows all 15 fields.

Just off the top of the head, Best, Steve.

All Answers

PremanathPremanath

Yes it's possible by using vf page

First you can create a vfpage ...add fields whatever you want.

Then Goto object-->Buttons and links-->You can Edit the Standard edit button override with VF page

 

<apex:page standardController="Account">
<apex:form >
<apex:pageBlock >
<apex:pageBlockButtons >
<apex:commandButton action="{!save}" value="save"/>
<apex:commandButton action="{!Cancel}" value="Cancel">
</apex:commandButton>
</apex:pageBlockButtons>
<apex:pageBlockSection title="My Content Section" columns="2">
<apex:inputField value="{!account.name}"/>
<apex:inputField value="{!account.site}"/>
<apex:inputField value="{!account.type}"/>
<apex:inputField value="{!account.accountNumber}"/>
<apex:inputField value="{!account.ParentID}"/>
<apex:inputField value="{!account.SLASerialNumber__c}"/>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>

 

 

Sapana WSapana W

Thanks Premanth,

 

But VF page is the last option, cant we do it using standard functionality ?

 

PremanathPremanath

No we can't it ...

But through pagelayouts we drag and drop some fields...But it's constant.

 

if your satisfy plz make above answer make solvable...it may others should benfit...

 

 

SteveBowerSteveBower

Could you set up the default record type for new records to be record type A which has an associated page layout which only shows 10 fields.

Then, create a workflow rule which only fires on record creation.  That rule does a field update to change the record to record type B which has a different associated page layout which shows all 15 fields.

Just off the top of the head, Best, Steve.

This was selected as the best answer
Sapana WSapana W

Thanks Steve ,

 

Your solution seems to be useful. But Please tell me how can we make a field upadate to change a record type.

It will be helpful if you give some steps of the same

SteveBowerSteveBower

Create the record types linked to the page layouts first.  .

 

Then Go to Setup -> Create -> Workflows -> Field Updates -> Create New (Button)   and read the online help to create the Field Update

 

After you create a Field Update action, you then go and create a Workflow Rule which will run the Field Update.   The online help should explain it all.

 

Best, Steve.

 

 

Sapana WSapana W

Thanks Steve,

 I implemented  your solution and it works good .Thanks again

nishad basha 7nishad basha 7
Hi, SFDCDeveloper

How can i change  Account record lables in visualforce page
nishad basha 7nishad basha 7
Hi, SteveBower


How can i change  Account record lables in visualforce page
plase give any example code on that how to solve this issue please give some ideas.