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
ArunaAruna 

How to get salesforce login url and customer portal login url in trigger

Hi All,

 

I need to get the salesforce login URL in Trigger.
 
i am using String hostname=ApexPages.currentPage().getHeaders().get('Host');
String domain='https://'+hostname;
< a href ="domain">link</a>
 
but it is giving me null pointer exception, am i doing any thing wrong.
 
and i have customer portal login url  https://tapp0.salesforce.com/secur/login_portal.jsp?orgId=00DT00000005ZRt&portalId=060T00000000SOS
 
i have to get that customer portal loginurl in trigger,how to get that

 

how can i append  object id to login url .

 

Thank you

 

--

kruti tandelkruti tandel

hi!

 

try this code

 

public with sharing class portalUrl{
Public String domain{get;set;}
    public portalUrl(){
    String hostname=ApexPages.currentPage().getHeaders().get('Host');
    domain = 'https://'+hostname+'/secur/login_portal.jsp?orgId=00DT00000005ZRt&portalId=060T00000000SOS';
    }
}