How to get fields for sObject using Apex?
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: ....
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 ....
To convert List to Set in Salesforce, add some values to List datatype and use addAll() to add it to Set datatype. Sample Code: List < String > tempList ....
Below is the simple example for popup in salesforce Visualforce page: <apex:page controller="popup"> <style type="text/css"> .popup { ....
Sample Code: String tempStr = 'test.78@gmail.com'; if ( Pattern.matches( '[a-zA-Z0-9._-]+@[a-zA-Z]+.[a-zA-Z]{2,4}', tempStr ) ) { System.debug( 'Regex Matched' ); } else { System.debug( 'Regex Pattern not Matched' ); } Output: