211 : While creating JavaScript button to execute anonymous apex, what should you keep in mind ?
Ans : End user must needs to have “Apex Author” permission and this is something should not be granted to end user. Also, while creating JavaScript button, user must be aware that its only supported in Salesforce classic and not in Salesforce Lightning.
212 : How to enable truncate custom object feature in Salesforce ?
Ans : Navigate to “App Setup | User Interface” and select “Enable Custom Object Truncate”.
213 : What may be reason truncate button is not visible on Custom Object ?
Ans :
- Are referenced by another object through a lookup field or that are on the master side of a master-detail relationship
- Are referenced in a reporting snapshot
- Have a custom index or an external ID
214 : How to report on User License field?
Ans :
Create formula field in User Object with formula “Profile.UserLicense.Name”.
Note: You need to copy and paste this value because it doesn’t show up in the fields drop down.
215 : Which custom fields or relationships in salesforce ends with “__pc” and “__pr” ?
Ans : In normal scenario all custom fields ends with “__c” and relationships ends with “__r” However for Person accounts, custom fields ends with “__pc” and custom relationship ends with “__pr”.
216 : Difference between Chatter API and Connect API.
Ans :
- Chatter API is REST API for Chatter to display Salesforce data, especially in mobile applications. Responses are localized, structured for presentation, and can be filtered to contain only what the app needs.
- Connect API provides apex classes for accessing the same data available in Chatter REST API. Use Chatter in Apex to create custom Chatter experiences in Salesforce.
217 : How to capture errors after using Database DML methods in Salesforce?
Ans :
List<Contact> lstContact = new List<Contact>(); Contact con = new Contact (lastName = 'Zaa', SQL_Server_Id__c='3',firstName='Jitendra'); lstContact.add(con); //.. Other Contact records added in List Database.UpsertResult[] results = Database.upsert( lstSGAccOppInsert, Contact.SQL_Server_Id__c.getDescribe().getSObjectField() ,false ) ; for(Integer i=0;i<results.size();i++){ if (!results.get(i).isSuccess()){ Database.Error err = results.get(i).getErrors().get(0); System.debug('Error - '+err.getMessage() + '\nStatus Code : '+err.getStatusCode()+'\n Fields : '+err.getFields()); } }
218 : What causes Concurrent Apex limit error in Salesforce ?
Ans : If Synchronous Apex runs more than 5 sec it considered as long running job. And we have limit that only 10 long running job can execute at a time. So, whenever 11th Synchronous apex tries to execute, it gets Concurrent Apex limit error. Read more here about Concurrent Request Limits
219. What is custom metadata type ?
Ans : Custom metadata was introduced generally in Summer 15 release. Before Custom metadata type, we were using Custom settings of List type. Problem with custom setting was that, during migration or in packages, data were not migrated. We had to either use data loader or some API to create initial data. However, if we package custom metadata type or migrate it, data will also be migrated along with it.
220. Which component in Salesforce ends with “__mdt” and “__s”?
Ans : Custom metadata types ends with “__mdt” (meta data type), just like custom object or custom fields ends with “__c”.
When we create Geolocation field in Salesforce, lets say by name “location__c” then internally Salesforce creates subfields with extension “__s“. In this case “location_latitude__s” and “location_longitude__s”.
Leave a Reply