In Salesforce Classic you do something like this
EmailMessage emailMessage = (EmailMessage)sendEmailDefaults.getTargetSObject();
emailMessage.FromAddress = 'my-email@example.com';
List<String> fromList = sendEmailDefaults.getFromAddressList();
if(fromList != null){
for (Integer i = fromList.size() - 1; i >= 0; i--) {
if (!fromList.get(i).equals(emailMessage.FromAddress)) {
fromList.remove(i);
}
}
}
In Lightning, however, this does not change the values in the picklist.
I kept searching and I found out that the picklist From on the Email message is called ValidatedFromAddress, instead of FromAddres. So, is there any possibilty to restrict the value of this picklist dinamically?3 réponses

Hi Longoni,Sorry for this issue you are encountering. May I suggest you please check with below link which might help.
Thanks,
Nagendra