How to get Salesforce URL using Apex?
getOrgDomainUrl() can be used in Salesforce Apex to get your org URL. getCurrentRequestUrl() can used in Salesforce Apex to get the URL of an entire request on a Salesforce instance. ....
getOrgDomainUrl() can be used in Salesforce Apex to get your org URL. getCurrentRequestUrl() can used in Salesforce Apex to get the URL of an entire request on a Salesforce instance. ....
isNumeric() can be used to check whether a string is numeric using Apex in Salesforce. Sample Code: String str = 'abc'; if ( str.isNumeric() ) { Integer intVal = Integer.ValueOf( ....
JSON.serialize() method can be used to create JSON String using Apex in Salesforce. Check the following code for reference Sample Code: Account objAccount = [ SELECT Id, Name, Phone, Website, ....
Date.daysInMonth() can be used to find the number of days for a month using Apex in Salesforce. Sample Code: Integer numberDays = Date.daysInMonth( 2014, 2 ); System.debug( 'No of days ....
Currency format in Salesforce Visualforce Page can be done using apex:outputText and apex:outputField. Example: <apex:outputText value="${0, number, ###,###,###,##0.00}"> <apex:param value="{!a}" /> </apex:outputText> <apex:outputText value="{0, number, currency}"> <apex:param value="{!inte}"/> </apex:outputText> Note: ....
Test.startTest() and Test.stopTest() are very useful when your test class hits Salesforce Governor Limits. The code inside Test.startTest() and Test.stopTest() have new set of Salesforce Governor Limits. As a good practice, make ....
Sample Code: Visualforce page1: <apex:page controller="Sample"> <apex:form > <apex:pageBlock > <apex:pageBlockButtons > <apex:commandButton value="Next Page" onclick="show();"/> </apex:pageBlockButtons> </apex:pageBlock> </apex:form> </apex:page> Apex class: public class Sample { public Sample() { } ....
Visualforce page: <apex:page controller="PDFController"> <apex:pageBlock > <apex:pageBlockTable value="{!listEmployees}" var="e"> <apex:column value="{!e.Name}"/> <apex:column value="{!e.Age__c}"/> </apex:pageBlockTable> </apex:pageBlock> </apex:page> Apex Controller: public class PDFController { public List<Employee__c> listEmployees {get;set;} public PDFController() { listEmployees ....
Clone: If a list is cloned, it duplicates it and has reference. Primitive data types are supported. Sample Code: Account Account1= new Account(Name='Test1'); Account Account2= new Account(Name='Test2'); List<Account> AccountList = ....
"ALL ROWS" keyword is used to fetch records form recycle bin in Salesforce. Sample SOQL: SELECT Id, AccountId FROM Contact WHERE IsDeleted = true ALL ROWS Execute the below code in ....