Search code examples
salesforceformulasalesforce-communities

Open external URL in same window using hyperlink formula in Salesforce Community


I have a custom formula field Client name and I am using the below sample formula to navigate to the external URL in the community.

HYPERLINK('http://salesforce.com', 'Salesforce', '_self')

It is opening in a new window instead of the current one, but I want it to open in the same window.

I tried _top and _parent as well, but it didn't work for me. In internal salesforce, it is working as expected.

IF(
AND(ISPICKVAL( Enrollment_Method__c , 'Online Enrollment'), 
NOT(Plan_Selection_Complete__c), 
ISPICKVAL(Status__c , 'Not Submitted') 
),
HYPERLINK("https://planconfirmationdev.benefitmall.com/planConfirmation/640338/0",Client_Link__c,"_self"),
IF(
AND(ISPICKVAL( Enrollment_Method__c , 'Online Enrollment'),
Plan_Selection_Complete__c,
ISPICKVAL(Status__c , 'Not Submitted')
),
HYPERLINK("https://bmall-enrollments.azurewebsites.net//canvas/ExternalLogin?enrollment_Id="+Id,Client_Link__c, "_self"),
IF(
OR(ISPICKVAL( Enrollment_Method__c , 'Manual Enrollment'),
ISPICKVAL(Status__c , 'Not Submitted') 
),
HYPERLINK("/s/enrollment/"+ Id+"/"+Name,Client_Link__c ),
HYPERLINK("/s/enrollment/"+ Id+"/"+Name,Client_Link__c )
)))

Solution

  • I got the answer from Salesforce regarding the above issue. We need to activate a critical update to use Hyperlinks at the lightning platform.

    Go to Setup >> Critical Update >> Lightning Experience Honors Target Values for Hyperlinks in Formula Fields >> Activate.