I'm trying to add the record link inside the "addError" on the trigger
for(Account account : (List<Account>) triggerParams.triggerNew) {
String url = URL.getOrgDomainUrl()+'/'+account.Id;
account.addError('ERROR:<a href=\''+url+'\'>More details</a>', false);
}
But the result is this
ERROR:<a href='Url:[delegate=https://myOrg.com]/0016w000007aC6fAAE'>More details</a>
Can someone help me?