You need to sign in to do that
Don't have an account?
Akshay Mhetre
Picklist to Text - Auto populate
Hello Everyone...
I have one picklist Hunter_Final_Status__c having Pending,Clear,Decline,Suspect values.
Condition:: Once any of (Hunter_Final_Status__c) above value is selected, that value should populate/Display in Hunter_Status__c (Text).
Please follow the below code:-
Make a trigger on object that have the required fields:-
Please mark it as Best Answer if it helps you.
Thanks & Regards
Suraj Tripathi
All Answers
You can try using workflow field update or process builder to acheive above functionality.
Thanks,
Please follow the below code:-
Make a trigger on object that have the required fields:-
Please mark it as Best Answer if it helps you.
Thanks & Regards
Suraj Tripathi
Hey Suraj
Few changes in requirments:: if I choose Hunter_Final_Status__c as "Clear" ,Hunter_Status__c (Field on Opportunity)(text field) should also change to "Clear"
trigger HunterStatusUpdate on Case (after update, after insert) {
List<case> caseList = trigger.new;
for(case caseRecord: caseList){
if(caseRecord.Hunter_Final_Status__c == Clear ){
Opportunity.Hunter_Status__c = caseRecord.Hunter_Final_Status__c;
}
}
update caseList;
}
facing errors::
A value cannot be stored to Hunter_Status__c in type Opportunity
Variable does not exist: Clear
Doubt:: while writing caseRecord.(Fields were not auto populating here) ...why?? same while Opportunity.(Fields were not auto populating here).
Please change Clear to this- 'Clear'.