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
Aivaras Geraltauskas 1Aivaras Geraltauskas 1 

AddError with URL in Lightning

I am trying to add a link to an error message in an apex class. I found that this is working in classsic but not lightning. I have read sone articles stating that this is not supported in lightning but these were older articles. I am just wondering if there are any workarounds for this or any other way i can add a link to an error message in lightning.

Thanks,
Aivaras.
Aivaras Geraltauskas 1Aivaras Geraltauskas 1
My code looks like this:

String url = URL.getOrgDomainUrl().toExternalForm()+'/'+exacc.Id;
                   NewAcc.name.adderror('Account Name Already Exists: <a href=\''+url+'\'>Duplicate Account</a>', false);