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
Nathalie DefrenneNathalie Defrenne 

How to create Validation Rule on Picklist to then fill in text field.

Hi I am new to Saleforce after many years. 

I am trying to create a rule that if Stage in Opportunity is Partner then a partner name field pops up to type in.  

Any advice on how to do this? I am back in the SF game and very rusty. 

Thanks, 

Nathalie 
Best Answer chosen by Nathalie Defrenne
Neetu_BansalNeetu_Bansal
Hi Nathalie,

You need to create a validation rule on Opportunity. Follow the below steps:
  • Go to Setup -> App setup -> Customize -> Opportunity -> Validation Rules, click Validation rules
  • Click New button
  • Enter any rule name
  • In the Error condition formula, enter the following formula: IF( AND( ISPICKVAL( StageName, 'Partner' ), ISBLANK( Partner_Name__c ), true, false )
  • Enter the error message and save the rule.
You need to replace the field API name as per your data model. Let me know, if you need any help.

Thanks,
Neetu

All Answers

R Z KhanR Z Khan
Hi Nathalie,

Sound like you need to have a custom VF page. You would need to write some javascript to hide/show the field based on the Stage field value. Standard page layouts dont let you show or hide fields on conditions. 
Neetu_BansalNeetu_Bansal
Hi Nathalie,

You need to create a validation rule on Opportunity. Follow the below steps:
  • Go to Setup -> App setup -> Customize -> Opportunity -> Validation Rules, click Validation rules
  • Click New button
  • Enter any rule name
  • In the Error condition formula, enter the following formula: IF( AND( ISPICKVAL( StageName, 'Partner' ), ISBLANK( Partner_Name__c ), true, false )
  • Enter the error message and save the rule.
You need to replace the field API name as per your data model. Let me know, if you need any help.

Thanks,
Neetu
This was selected as the best answer
Nathalie DefrenneNathalie Defrenne
Hi Neetu, Thank you so much for helping me with this! It worked!! Do you know of anywhere I can find free tutorials or documents on how to build validation rules? I seem to be foreign to this language. Thank you, Nathalie
Neetu_BansalNeetu_Bansal
Hi Nathalie,

I can help you with the tutorials or guidance regarding this. You can contact me either on my gmail id neetu.bansal.5@gmail.com or Skype Id neetu.bansal.5

If my post helps you, you can mark it as best answer so it will help others in future.

Thanks,
Neetu
harsha naik 8harsha naik 8
HI Nathalie ,

your validation rule is syntax error when i have try do can not save, try is ..

If( AND (ISPICKVAL( StageName,'Prospecting'), ISBLANK( OrderNumber__c)),true,false)