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
SunadminSunadmin 

Auto populate custom field with standard field value using formula or validation rule

 

Hello,

 

I have an Visualforce page I created that uses an Apex class to query date/time fields from an Account page. In order to filter out unwanted queries I created a custom field (customer_credit_name_c). Now I have two name fields on the Account page and it is confusing. Is there a way to set up a custom formula or rule to auto populate the custom field from the standard name field? I want to be able to hide the custom field. I can include the Apex class and VF page if needed.

 

Thanks

 

Best Answer chosen by Admin (Salesforce Developers) 
Ritesh AswaneyRitesh Aswaney

You could set up a Workflow rule to copy the value from the Standard Name field to your Custom Name Field ?

All Answers

Ritesh AswaneyRitesh Aswaney

You could set up a Workflow rule to copy the value from the Standard Name field to your Custom Name Field ?

This was selected as the best answer
SunadminSunadmin

Thanks Ritesh, could you give me some guidance on how to set the workflow rule up? Should I use a filter such as "contains" and then set it to contain the Name Field?

for example:

Rule Criteria   (Account: Name CONTAINS value)

 

   Workflow Action 

         Type: (Field Update) COPY Name TO Credit_Customer_Name_C

 

I am not sure if the syntax is right but I hope the I got the basic idea across.  

Ritesh AswaneyRitesh Aswaney
For the rule criteria you could just say Name not equals to And leave the value field blank (implies null) I'd recommend that you use the dropdown condition builder rather than try and write a formula
SunadminSunadmin

Thanks Ritesh, i will give it a shot and post the solution.