{"id":2762,"date":"2012-03-10T15:50:07","date_gmt":"2012-03-10T10:20:07","guid":{"rendered":"http:\/\/JitendraZaa.com\/blog\/?p=2762"},"modified":"2015-02-09T01:29:34","modified_gmt":"2015-02-09T01:29:34","slug":"salesforce-interview-questions-part-6","status":"publish","type":"post","link":"https:\/\/www.jitendrazaa.com\/blog\/salesforce\/salesforce-interview-questions-part-6\/","title":{"rendered":"Salesforce Interview Questions &#8211; Part 6"},"content":{"rendered":"<div class=\"intrinsic-container\"><iframe loading=\"lazy\" src=\"https:\/\/jitendrazaa.com\/blog\/SFDCInterviewList.php?num=6\" width=\"300\" height=\"150\" allowfullscreen=\"allowfullscreen\"> <\/iframe><\/div>\n<p><strong>51. Explain Permission sets released in Winter 12.<\/strong><br \/>\n<strong>Ans :<\/strong><br \/>\nA permission set is a collection of settings and permissions that give users access to various tools and functions. The settings and permissions in permission sets are also found in profiles, but <strong>permission sets extend users&#8217; functional access without changing their profiles<\/strong>. For example, to give users access to a custom object, create a permission set, enable the required permissions for the object, and assign the permission set to the users. You never have to change profiles, or create a profile for a single use case. While users can have only one profile, they can have multiple permission sets.<!--more--><\/p>\n<hr \/>\n<p><strong>52. What is the difference between External ID and Unique ID?<br \/>\nAns:<br \/>\nExternal ID<\/strong><br \/>\nThis is a field that usually references an ID from another (external) system. For instance, if the customer has an Oracle Financials system that they will be linking with salesforce.com, it may be easier for them to be able to refer to the Oracle ID of account records from within salesforce. So they would create an external ID in salesforce.com and they would load the Oracle ID into that field for each account. They can then refer to that ID field, rather than the salesforce.com id.<\/p>\n<p>Additionally, if you have an external ID field, the field becomes searchable in the sidebar search. You also can use the upsert API call with the extenal ID to refer to records.<\/p>\n<p>You can have multiple records with the same external ID (though it is not reccomended, as it will defeat the purpose of the external id) .<\/p>\n<p>External Id available for Text, Number and Email field types.<\/p>\n<p>External Id is used in upsert operations.<\/p>\n<ul>\n<li>If external id is absenor not matched then insert happens.<\/li>\n<li>If external id matched once then record will be updated.<\/li>\n<li>If external id is matched multiple times then error occurs.<\/li>\n<\/ul>\n<p><strong>Unique ID field<\/strong><\/p>\n<p>This is a setting for the field that will prevent you from using the same value in multiple records for the unique field. So if I create a 5 character text field and make it unique, and I create a record with the value &#8220;12345&#8221; i will not be able to create another record with that same value in the unique field. If i try to do so, I will get an error saying that the value is already in use.<\/p>\n<p>Often, External Ids are set with the unique property so that the IDs will be unique to each record.<\/p>\n<figure id=\"attachment_2765\" aria-describedby=\"caption-attachment-2765\" style=\"width: 628px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/jitendrazaa.com\/blog\/wp-content\/uploads\/2012\/03\/Salesforce-External-Id-option-while-creating-field.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-2765\" title=\"Salesforce - External Id option while creating field\" src=\"https:\/\/i0.wp.com\/jitendrazaa.com\/blog\/wp-content\/uploads\/2012\/03\/Salesforce-External-Id-option-while-creating-field.png?resize=628%2C364&#038;ssl=1\" alt=\"Salesforce - External Id option while creating field\" width=\"628\" height=\"364\" \/><\/a><figcaption id=\"caption-attachment-2765\" class=\"wp-caption-text\">Salesforce &#8211; External Id option while creating field<\/figcaption><\/figure>\n<hr \/>\n<p><strong>53. How to get the picklist value in Apex class?<\/strong><br \/>\n<strong> Ans :<\/strong><br \/>\nUsing Dynamic apex, we can achieve this.on object of type pickilist, call <strong>getDescribe()<\/strong>. then call the <strong>getPicklistValues()<\/strong> method. iterate over result and create a list. bind it to &lt;apex:selectOptions&gt;.<\/p>\n<hr \/>\n<p><strong>54. What are the types of controller in visual force?<br \/>\nAns :<\/strong><br \/>\nThere are basically two types of Controller in Visual force page.<\/p>\n<ol>\n<li>Standard Controller and<\/li>\n<li>Custom Controller<\/li>\n<\/ol>\n<hr \/>\n<p><strong>55. How many Controllers can be used on single VF page?<br \/>\nAns :<\/strong><\/p>\n<p>Only one controller can be used salesforce. Other than them, <strong>Controller extension<\/strong> can be used. There may be more than one Controller extention.<br \/>\nExample :<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;apex:page standardController=&quot;Account&quot;\r\nextensions=&quot;ExtOne,ExtTwo&quot; showHeader=&quot;false&quot;&gt;\r\n&lt;apex:outputText value=&quot;{!foo}&quot; \/&gt;\r\n&lt;\/apex:page&gt;\r\n<\/pre>\n<p>if ExtOne and ExtTwo, both have the method <strong> getFoo()<\/strong> then the method of ExtOne will be executed.<\/p>\n<p>A controller extension is any Apex class that contains a constructor that takes a single argument of type <strong>ApexPages.StandardController<\/strong> or <strong>CustomControllerName<\/strong>, where CustomControllerName is the name of a custom controller that you want to extend.<\/p>\n<hr \/>\n<p><strong>56. Explain System.runAs()<br \/>\nAns : <\/strong><br \/>\nGenerally, all Apex code runs in system mode, and the permissions and record sharing of the current user are not taken into account. The system method, <strong>System.runAs()<\/strong>, lets you write test methods that change user contexts to either an existing user or a new user. All of that user&#8217;s record sharing is then enforced. <strong>You can only use runAs in a test method<\/strong>. The original system context is started again after all runAs() test methods complete.<br \/>\nExample :<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\nSystem.runAs(u) {\r\n\/\/ The following code runs as user 'u'\r\nSystem.debug('Current User: ' + UserInfo.getUserName());\r\nSystem.debug('Current Profile: ' + UserInfo.getProfileId()); }\r\n\/\/ Run some code that checks record sharing\r\n}\r\n<\/pre>\n<hr \/>\n<p><strong>57. Explain Test.setPage().<br \/>\nAns:<\/strong><br \/>\nIt is used to set the context to current page, normally used for testing the visual force controller.<\/p>\n<hr \/>\n<p><strong>58. What is the custom settings ?<br \/>\nAns : <\/strong><br \/>\nCustom settings are similar to custom objects and enable application developers to create custom sets of data, as well as create and associate custom data for an organization, profile, or specific user. All custom settings data is <strong>exposed in the application cache<\/strong>, which enables efficient access without the cost of repeated queries to the database. This data can then be used by formula fields, validation rules, Apex, and the Web services API.<\/p>\n<hr \/>\n<p><strong>59. Types of the custom settings?<br \/>\nAns : <\/strong><br \/>\n<strong>List Custom Settings<\/strong><br \/>\nA type of custom setting that provides a reusable set of static data that can be accessed across your organization. If you use a particular set of data frequently within your application, putting that data in a list custom setting streamlines access to it.<strong> Data in list settings does not vary with profile or user, but is available organization-wide<\/strong>. Examples of list data include two-letter state abbreviations, international dialing prefixes, and catalog numbers for products. Because the data is cached, access is low-cost and efficient: you don&#8217;t have to use SOQL queries that count against your governor limits.<\/p>\n<p><strong>Hierarchy Custom Settings<\/strong><br \/>\nA type of custom setting that uses a built-in hierarchical logic that lets you &#8220;personalize&#8221;\u009d settings for specific profiles or users. The hierarchy logic checks the organization, profile, and user settings for the current user and returns the most specific, or &#8220;lowest,&#8221;\u009d value. In the hierarchy, settings for an organization are overridden by profile settings, which, in turn, are overridden by user settings.<\/p>\n<hr \/>\n<p><strong>60. Difference between SOSL and SOQL in Salesforce ?<br \/>\nAns :<\/strong><br \/>\n\n<table id=\"tablepress-5\" class=\"tablepress tablepress-id-5\">\n<thead>\n<tr class=\"row-1\">\n\t<th class=\"column-1\"><div>SOSL<\/div><\/th><th class=\"column-2\"><div>SOQL<\/div><\/th>\n<\/tr>\n<\/thead>\n<tbody class=\"row-striping row-hover\">\n<tr class=\"row-2\">\n\t<td class=\"column-1\">stands for \"Salesforce object search language\".<\/td><td class=\"column-2\">stands for \"Salesforce object query language\".<\/td>\n<\/tr>\n<tr class=\"row-3\">\n\t<td class=\"column-1\">Works on multiple object at a same time.<\/td><td class=\"column-2\">Need to write different SOQL for different object.<\/td>\n<\/tr>\n<tr class=\"row-4\">\n\t<td class=\"column-1\">All fields are already text indexed.<\/td><td class=\"column-2\">SOQL against same field will be slow.<\/td>\n<\/tr>\n<tr class=\"row-5\">\n\t<td class=\"column-1\">Cannot used in Triggers. Can only be used in Apex class and anonymous block.<\/td><td class=\"column-2\">Can be used in Apex class and Triggers.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<!-- #tablepress-5 from cache --><\/p>\n<div class=\"intrinsic-container\"><iframe loading=\"lazy\" src=\"https:\/\/jitendrazaa.com\/blog\/SFDCInterviewList.php?num=6\" width=\"300\" height=\"150\" allowfullscreen=\"allowfullscreen\"> <\/iframe><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Basic concepts and Interview Questions of salesforce, Visualforce, Apex and SOQL<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"advanced_seo_description":"","jetpack_seo_html_title":"","jetpack_seo_noindex":false,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"jz_research_post":"","_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[20,23,9],"tags":[331],"class_list":["post-2762","post","type-post","status-publish","format-standard","hentry","category-apex","category-configuration","category-salesforce","tag-salesforce"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":2971,"url":"https:\/\/www.jitendrazaa.com\/blog\/salesforce\/salesforce-interview-questions-part-8\/","url_meta":{"origin":2762,"position":0},"title":"Salesforce Interview Questions \u2013 Part 8","author":"Jitendra","date":"July 23, 2012","format":false,"excerpt":"Part 8 interview question is going to be around reports and profiles related question as i have seen this type of questions in lot of interviews. 71. If user doesn't have any right on particular record and have only read level access at object level. Can he change the record\u2026","rel":"","context":"In &quot;Salesforce&quot;","block_context":{"text":"Salesforce","link":"https:\/\/www.jitendrazaa.com\/blog\/category\/salesforce\/"},"img":{"alt_text":"Salesforce Report - Printable view and Export Details","src":"https:\/\/i0.wp.com\/jitendrazaa.com\/blog\/wp-content\/uploads\/2012\/07\/Salesforce-Report-Printable-view-and-Export-Details.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jitendrazaa.com\/blog\/wp-content\/uploads\/2012\/07\/Salesforce-Report-Printable-view-and-Export-Details.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jitendrazaa.com\/blog\/wp-content\/uploads\/2012\/07\/Salesforce-Report-Printable-view-and-Export-Details.png?resize=525%2C300&ssl=1 1.5x"},"classes":[]},{"id":4698,"url":"https:\/\/www.jitendrazaa.com\/blog\/salesforce\/my-favorite-appexchange-products\/","url_meta":{"origin":2762,"position":1},"title":"Top Salesforce tools , AppExchange and Heroku applications","author":"Jitendra","date":"July 1, 2015","format":false,"excerpt":"List of all my favorite Appexchange products, Heroku applications , Git repository , Free Source codes and some important Blog posts in Salesforce","rel":"","context":"In &quot;Salesforce&quot;","block_context":{"text":"Salesforce","link":"https:\/\/www.jitendrazaa.com\/blog\/category\/salesforce\/"},"img":{"alt_text":"Top Salesforce Tools","src":"https:\/\/i0.wp.com\/www.jitendrazaa.com\/blog\/wp-content\/uploads\/2015\/07\/Top-Salesforce-Tools.png?fit=1200%2C675&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.jitendrazaa.com\/blog\/wp-content\/uploads\/2015\/07\/Top-Salesforce-Tools.png?fit=1200%2C675&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.jitendrazaa.com\/blog\/wp-content\/uploads\/2015\/07\/Top-Salesforce-Tools.png?fit=1200%2C675&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.jitendrazaa.com\/blog\/wp-content\/uploads\/2015\/07\/Top-Salesforce-Tools.png?fit=1200%2C675&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/www.jitendrazaa.com\/blog\/wp-content\/uploads\/2015\/07\/Top-Salesforce-Tools.png?fit=1200%2C675&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":2825,"url":"https:\/\/www.jitendrazaa.com\/blog\/salesforce\/salesforce-interview-questions-part-7\/","url_meta":{"origin":2762,"position":2},"title":"Salesforce Interview Questions &#8211; Part 7","author":"Jitendra","date":"April 23, 2012","format":false,"excerpt":"Basic concepts and Interview Questions of salesforce, Visualforce, Apex and SOQL","rel":"","context":"In &quot;Apex&quot;","block_context":{"text":"Apex","link":"https:\/\/www.jitendrazaa.com\/blog\/category\/salesforce\/apex\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":7778,"url":"https:\/\/www.jitendrazaa.com\/blog\/salesforce\/when-to-use-multiple-experience-cloud-vs-audience\/","url_meta":{"origin":2762,"position":3},"title":"When to use Multiple Experience Cloud vs Audience","author":"Jitendra","date":"April 26, 2023","format":false,"excerpt":"What to use for user segmentation in Salesforce - multiple Experience Cloud vs Audience","rel":"","context":"In &quot;Salesforce&quot;","block_context":{"text":"Salesforce","link":"https:\/\/www.jitendrazaa.com\/blog\/category\/salesforce\/"},"img":{"alt_text":"Salesforce experience cloud vs Audience","src":"https:\/\/i0.wp.com\/www.jitendrazaa.com\/blog\/wp-content\/uploads\/2023\/04\/Salesforce-experieince-cloud.png?fit=1200%2C675&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.jitendrazaa.com\/blog\/wp-content\/uploads\/2023\/04\/Salesforce-experieince-cloud.png?fit=1200%2C675&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.jitendrazaa.com\/blog\/wp-content\/uploads\/2023\/04\/Salesforce-experieince-cloud.png?fit=1200%2C675&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.jitendrazaa.com\/blog\/wp-content\/uploads\/2023\/04\/Salesforce-experieince-cloud.png?fit=1200%2C675&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/www.jitendrazaa.com\/blog\/wp-content\/uploads\/2023\/04\/Salesforce-experieince-cloud.png?fit=1200%2C675&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":6933,"url":"https:\/\/www.jitendrazaa.com\/blog\/salesforce\/federated-search-in-salesforce\/","url_meta":{"origin":2762,"position":4},"title":"Federated Search in Salesforce","author":"Jitendra","date":"January 2, 2020","format":false,"excerpt":"Search content of Jitendra Zaa's blog using federated search in Salesforce","rel":"","context":"In &quot;Salesforce&quot;","block_context":{"text":"Salesforce","link":"https:\/\/www.jitendrazaa.com\/blog\/category\/salesforce\/"},"img":{"alt_text":"Federated Search in Salesforce","src":"https:\/\/i0.wp.com\/www.jitendrazaa.com\/blog\/wp-content\/uploads\/2020\/01\/Federated-Search-in-Salesforce.png?fit=1000%2C501&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.jitendrazaa.com\/blog\/wp-content\/uploads\/2020\/01\/Federated-Search-in-Salesforce.png?fit=1000%2C501&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.jitendrazaa.com\/blog\/wp-content\/uploads\/2020\/01\/Federated-Search-in-Salesforce.png?fit=1000%2C501&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.jitendrazaa.com\/blog\/wp-content\/uploads\/2020\/01\/Federated-Search-in-Salesforce.png?fit=1000%2C501&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":4546,"url":"https:\/\/www.jitendrazaa.com\/blog\/salesforce\/system-mode-or-god-mode-in-apex-gotchas\/","url_meta":{"origin":2762,"position":5},"title":"System mode or God mode in Apex &#8211; Gotchas","author":"Jitendra","date":"June 8, 2015","format":false,"excerpt":"Gotchas of System mode or God mode in Apex and its impact by using \"With sharing\" keyword in Salesforce","rel":"","context":"In &quot;Apex&quot;","block_context":{"text":"Apex","link":"https:\/\/www.jitendrazaa.com\/blog\/category\/salesforce\/apex\/"},"img":{"alt_text":"Salesforce God Mode failing","src":"https:\/\/i0.wp.com\/www.jitendrazaa.com\/blog\/wp-content\/uploads\/2015\/06\/Salesforce-God-Mode-failing.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.jitendrazaa.com\/blog\/wp-content\/uploads\/2015\/06\/Salesforce-God-Mode-failing.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.jitendrazaa.com\/blog\/wp-content\/uploads\/2015\/06\/Salesforce-God-Mode-failing.png?resize=525%2C300&ssl=1 1.5x"},"classes":[]}],"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/www.jitendrazaa.com\/blog\/wp-json\/wp\/v2\/posts\/2762","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.jitendrazaa.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.jitendrazaa.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.jitendrazaa.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.jitendrazaa.com\/blog\/wp-json\/wp\/v2\/comments?post=2762"}],"version-history":[{"count":3,"href":"https:\/\/www.jitendrazaa.com\/blog\/wp-json\/wp\/v2\/posts\/2762\/revisions"}],"predecessor-version":[{"id":4220,"href":"https:\/\/www.jitendrazaa.com\/blog\/wp-json\/wp\/v2\/posts\/2762\/revisions\/4220"}],"wp:attachment":[{"href":"https:\/\/www.jitendrazaa.com\/blog\/wp-json\/wp\/v2\/media?parent=2762"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.jitendrazaa.com\/blog\/wp-json\/wp\/v2\/categories?post=2762"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.jitendrazaa.com\/blog\/wp-json\/wp\/v2\/tags?post=2762"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}