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
Rajiv B 3Rajiv B 3 

Autopopulate custom field upon selecting picklist value

Custom picklist field Called Status__C in Case object.

Requirment:
Once user select Status__C field value as Rejected need custom field called Rejected__Reason__C should auto populate next to Status__C  to enter rejected reason.

How to achieve this??

can we have any out of box functionality ??

need any code development ??

Thanks in advance
Best Answer chosen by Rajiv B 3
Chetan KapaniaChetan Kapania
You can achieve this functionality in case both Status as well as Rejected Reason field are of picklist type. In case you have already mentioned more than one reason under Rejected Reason picklist, then you can control it through Status field. 

From Setup, you go to Status field. Under Field Dependency, click New and select Rejected Reason field. Once selected, click continue and you have the option to select Reject reason value right under Rejected and then click Include Values and then save the same. 

Then go to Rejected Reason field through Setup, select  "Restrict picklist to the values defined in the value set" checkbox under General option. Also, under controlling field option choose Status.

By doing the same, Rejected Reason field will be active only when Status "Rejected" is selected, for every other option it will remain greyed out. 



 

All Answers

Shivdeep KumarShivdeep Kumar
Hi Rajiv,

Use the validation rule to populate the error on Rejected__Reason__C field .
IF( ISPICKVAL(Status, 'Escalated'),Description = null , false)
Regards
Shivdeep
Rajiv B 3Rajiv B 3

Thanks Shivdeep for your response ..

does this validation rule will auto populate the rejected reason when only onces user s slect status as Rejected ..
actully Rejected_Reason__C shuould not display on User interface/Detailpage/edit since before user select Status as Rejected

 

Chetan KapaniaChetan Kapania
You can achieve this functionality in case both Status as well as Rejected Reason field are of picklist type. In case you have already mentioned more than one reason under Rejected Reason picklist, then you can control it through Status field. 

From Setup, you go to Status field. Under Field Dependency, click New and select Rejected Reason field. Once selected, click continue and you have the option to select Reject reason value right under Rejected and then click Include Values and then save the same. 

Then go to Rejected Reason field through Setup, select  "Restrict picklist to the values defined in the value set" checkbox under General option. Also, under controlling field option choose Status.

By doing the same, Rejected Reason field will be active only when Status "Rejected" is selected, for every other option it will remain greyed out. 



 
This was selected as the best answer
Rajiv B 3Rajiv B 3
HI Chetan Thanks for reply ...

Actually Rejected_Reason__C is a Text field ... where user enter desired descriptioon. Reson is not fiexed.

Can we auto populate Text datatype field with picklist select type...

is there any approach
Chetan KapaniaChetan Kapania
Hi Rajiv,

As per my knowledge goes required functionality is not possible through standard point and click customization. You need to seek assistance of developer for writing code for such requirement. I will try to look for such code from my end, but you can contact developer in meantime.

Regards
Chetan
Rajiv B 3Rajiv B 3
Thanks @ Chetan.. if you can provide code .. Appreciate you