Posts

Showing posts from January, 2015

Advanced Developer Certification, DEV 501 Quick Points Part-II

The apex array is dynamic, but java array is static If field history is enabled for an object the data which is getting stored in field history will be anyType. Enum data type methods: ordinal():- returns the position of item in the list Name():- returns the name of the enum item as a string values():- static method that returns the list of values SaveResult object has 3 methods . Id getId() List<Database.Error> getErrors() Boolean isSuccess() If the DML operation contains only one record we can use saveResult instead of list<SaveResult> External field contains externalid attribute. Execution of setsavePoint(), rollback() counts against the total number of DML statements. You cannot add isdeleted flag into page layout. Trigger by definition will not receive more than 200 records in trigger.new Each DML statement can only operate on one type of SObject at a time. Merging limited to 3 records at a time and its limited to leads, accounts, contacts. If there are

Advanced Developer Certification, DEV 501 Quick Points Part-I

DEV 501 Quick Notes #Referred from another blog. Quick notes to take before Advanced Developer certification exam: Would be useful for all developers.   1.      ReadOnly Annotation prevents you from performing the following operations within the request: ·         DML operation,  ·         system.schedule method, ·         calls to future method, ·         sending emails 2.      To increase other Visualforce-specific limits, such as the size of a collection that can be used by an iteration component like <apex:pageBlockTable>, you can set the readonly attribute on the <apex:page> tag to true . 3.   C lass defined with @isTest should not be interface or enums. 4.      future annotation: o    Method with future annotation cannot be used in getter, setter, constructor methods o    Future annotated methods must be defined as static and can return only void return type. 5.      Map Key can hold null value. 6.      Methods with the Rem

Salesforce Basic Interview Questions

1. What is App in Sales force? An app is a group of tabs that work as a unit to provide functionality. Users can switch between apps using the Force.com app drop-down menu at the top-right corner of every page. You can customize existing apps to match the way you work, or build new apps by grouping standard and custom tabs. Navigation to create app in Sales force: Setup ->Build ->Create->App-> Click on new and create your application according to your requirements. 2. What is object in Salesforce? Custom objects are database tables that allow you to store data specific to your organization in salesforce.com. You can use custom objects to extend salesforce.com functionality or to build new application functionality. Once you have created a custom object, you can create a custom tab, custom related lists, reports, and dashboards for users to interact with the custom object data. You can also access custom object data through the Force.com API. To create object in

What does Salesforce ID compose of? and How to Convert 15 Character Id to 18 Character Id

Id Field Type  is a base-62 encoded string. Each character can be one of 62 possible values: a lowercase letter (a-z) - 26 values an uppercase letter (A-Z) - 26 values a numeric digit (0-9) - 10 values Within a 15 character Id the breakdown is: (CASE SENSITIVE) First 3 characters - First 3 characters are the  key prefix  that identify the object type. In Case of Standard objects : Same Unique key prefix across all the orgs. (very useful in case you have hardcoded standard object id in apex, so now you won't need to change it when deployed in other org) In Case of Custom objects : Unique key prefix per Org, but have a different key prefix in each installed org. ( How to get object key prefix ) Remaining 12 characters - These is a 62^12 number. It is common to see the first character in this sequence set to a value other than 0 even though most of the following characters are zero. This appears to be some kind of offset and may have significance. Review  -a comment fr

Get Key Prefix of Object in Salesforce

Image
Using Apex: You can use DescribeSObjectResult() method to get Custom and Standard Object prefix in apex class. For ex:  Lets say we have a custom object "Group_Task__c", and instead of hardcoding Object Id we want to make it dynamic. Schema.DescribeSObjectResult result = Group_Task__c.SObjectType.getDescribe(); PageReference pageRef = new PageReference('/' + result.getKeyPrefix()); pageRef.setRedirect(true); return pageRef; Using Workbench: Log into workbench-> go to Info > Standard & Custom Objects and pick an object from the pick list.

List of Key Prefixes in Salesforce

Image
Here is the list of Key prefixes used in Salesforce:  (If you have any more key prefix that is missing in the below list please comment below, I will add it) Key Prefix Object Type 000 Empty Key 001 Account 002 Note 003 Contact 005 User 006 Opportunity 007 Activity 008 OpportunityHistory 00B ListView / View 00D Organization 00E UserRole 00G Group 00I Partner Also OpportunityPartner, which "is automatically created when a Partner object is created for a partner relationship between an account and an opportunity" 00J OpportunityCompetitor 00K OpportunityContactRole 00N CustomFieldDefinition - Setup > Create > Objects > [Your Object] > [Your Field] CF00N Custom Field Id using in the query string. Note the keyprefix isn't actually CF0. In this case "CF" has been appended to the "00N" of the Custom Field Definition. 00O Report 00P Attachment 00Q Lead 00S ImportQueue 00T Task 00U Event 00X EmailTemplate 00Y EmailTem