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
gailhgailh 

Default value on a hidden input

I'm creating a Visualforce page because we are going to be creating "Account Name" based on a custom field "Proper Account Name" and "Account Site", using workflow field update rules. If I don't create the page, then Account Name is required but then gets overridden upon saving the account. The purpose of the visualforce page is to replace the "New" account button and display all fields EXCEPT Account Name. Account Name will be hidden and default to any value. I just can't figure out for the life of me how to set the Account Name value. Any help appreciated. Rather new to this and wanted to wait a few months before starting to use this but this requirement is too important to ignore for now.... Any other suggestions on how to skin this cat are also appreciated...

 


 
<apex:page standardController="Account">
<apex:form > <apex:pageBlock title="Edit Account"> <apex:pageMessages /> <apex:pageBlockButtons > <apex:commandButton value="Save" action="{!save}"/> <apex:commandButton value="Cancel" action="{!cancel}"/> </apex:pageBlockButtons> <apex:pageBlockSection > <apex:inputHidden value="{!account.name}" /> <apex:inputField value="{!account.Site}" /> <apex:inputField value="{!account.Proper_Account_Name__c}" /> </apex:pageBlockSection> </apex:pageBlock> </apex:form> </apex:page>
</apex:page>

 

 

Best Answer chosen by Admin (Salesforce Developers) 
gailhgailh
d'oh! Account Site was hidden when I first started out and I didn't see that it's now included when you convert leads so no need for this at all!