How to get the URL for the object tab in Salesforce?

How to get the URL for the object tab in Salesforce?

Use the following sample code for reference to get the URL for the object tab in Salesforce using Apex.

Sample Code:

Schema.DescribeSObjectResult r = Account.sObjectType.getDescribe();
String URLforObj = URL.getOrgDomainUrl();
URLforObj += r.getKeyPrefix() + '/o';

Leave a Reply