Difference between SOSL and SOQL
SOSL stands(Salesforce object search language) SOQL stands for(Salesforce object query language) Works on multiple objects at the same time. Need to write different SOQL for multiple objects. Cannot be used ....
SOSL stands(Salesforce object search language) SOQL stands for(Salesforce object query language) Works on multiple objects at the same time. Need to write different SOQL for multiple objects. Cannot be used ....
To display error messages in the Visualforce page add below tag where you want to display the error message. Visualforce page: <apex:pageMessages /> Apex Controller: ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'Error ....
Asserts that the first two arguments are the same. If they are not, a fatal error is returned that causes code execution to halt. Sample Code: Trigger: trigger AccountTrigger on ....
In order to get all fields of an Object in Salesforce, getGlobalDescribe() and getDescribe() from the Schema class can be utilized or we can query the FieldDefinition entity. Sample Code: ....
To parse CSV to sObject using Apex in Salesforce, use the below link to get the code http://wiki.developerforce.com/page/Code_Samples#Parse_a_CSV_with_APEX Sample code: public List<List<String>> parseCSV(String contents,Boolean skipHeaders) { List<List<String>> allFields = new ....
Examples: Example 1: FIND {test*} IN ALL FIELDS RETURNING Account (Id, Name), Contact, Opportunity, Lead Searches field values starting with the keyword 'test' in all fields in Account, Contact, Opportunity, ....
Unlike SOQL, which can only query one object at a time and multiple objects only if they are related to each other, SOSL enables you to search text, email, and ....
The daysBetween() method can be used to find number of days between two dates. Example: Integer noOfDays = startDate.daysBetween( endDate ); Execute the following sample code in Developer Console to view the ....
To convert sObject to String in Apex, below is the simple code. Example: public Account acct = new Account(Name = 'Test Account'); String objType = String.valueOf(acct); system.debug('objType is ' + objType); ....
In SOQL, the LIKE operator is supported for string fields only. So, we cannot use it against any other field data types. Syntax: String strSOQL = 'SELECT FieldAPIName FROM sObject ....