{"id":3218,"date":"2013-05-24T04:30:27","date_gmt":"2013-05-23T23:00:27","guid":{"rendered":"http:\/\/JitendraZaa.com\/blog\/?p=3218"},"modified":"2015-02-09T01:35:19","modified_gmt":"2015-02-09T01:35:19","slug":"salesforce-interview-question-part-15","status":"publish","type":"post","link":"https:\/\/www.jitendrazaa.com\/blog\/salesforce\/salesforce-interview-question-part-15\/","title":{"rendered":"Salesforce Interview Question \u2013 Part 15"},"content":{"rendered":"<div class=\"intrinsic-container\"><iframe loading=\"lazy\" src=\"https:\/\/jitendrazaa.com\/blog\/SFDCInterviewList.php?num=15\" width=\"300\" height=\"150\" allowfullscreen=\"allowfullscreen\"> <\/iframe><\/div>\n<p><strong>141 : User Wants to set the starting day in Calendar as &#8220;Monday&#8221; instead of &#8220;Sunday&#8221;. How to get it done?<\/strong><br \/>\n<strong> Ans :<\/strong> Change the user locale to &#8220;English ( United Kingdom ) &#8221; in Personal information or User record.<\/p>\n<hr \/>\n<p style=\"text-align: justify;\"><strong>142 : Why CSS is not working in PDF created by Visualforce ?<\/strong><br \/>\n<strong> Ans :<\/strong> In Many cases, i have observed problems faced by my colleagues and complaining that CSS is not working when they try to render any Visualforce page as &#8220;PDF&#8221;. Same Question is asked many times in Interviews also. Basically there are two ways:<\/p>\n<ol>\n<li style=\"text-align: justify;\">Use &#8220;apex:stylesheet&#8221; tag to import external CSS file<\/li>\n<li style=\"text-align: justify;\">Wrap &#8220;Style&#8221; tag inside &#8220;Head&#8221; tag in Visualforce<\/li>\n<\/ol>\n<hr \/>\n<p><strong>143 : How to get Ip Address of User in Apex?<\/strong><br \/>\n<strong> Ans :<\/strong><\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\nString ipAddress = ApexPages.currentPage().getHeaders().get('X-Salesforce-SIP');\r\n<\/pre>\n<p>True-Client-IP has the value when the request is coming via the caching integration.<br \/>\nX-Salesforce-SIP has the value if there is no caching integration (sandbox, developer edition orgs) or via the secure url.<br \/>\n<a title=\"Get IP Address in Apex\" href=\"http:\/\/www.tehnrd.com\/ip-address-geolocation-with-force-com\/\" rel=\"nofollow\">Thanks to TechNrd for this tips.<!--more--><\/a><\/p>\n<hr \/>\n<p style=\"text-align: justify;\"><strong>144 : How to get total number of Child records in Lookup relationship?<\/strong><br \/>\n<strong> Ans:<\/strong> As Rollup Summary field is only supported in Master detail, we cannot use it for Lookup. There are following two ways (If anyone has any other idea please comment).<\/p>\n<ol>\n<li style=\"text-align: justify;\"><em>Inline Visualforce page<\/em><\/li>\n<li style=\"text-align: justify;\"><em>Trigger<\/em> on Child Object, which will update field in Parent record if child record is inserted, deleted or undeleted.<\/li>\n<\/ol>\n<hr \/>\n<p><strong>145 : System admin has created a Visualforce for Account. In future he created few more new Fields. How could System admin can code Visualforce so that in future if any new field is added or existing field deleted. It should reflect in Visualforce without changing anycode?<\/strong><br \/>\n<strong> Ans :<\/strong> <a title=\"Field Set Usage in Visualforce\" href=\"https:\/\/jitendrazaa.com\/blog\/salesforce\/visualforce\/using-fieldset-with-visualforce-and-apex\/\">It can be done with help of Field Sets. Please read this article.<\/a><\/p>\n<hr \/>\n<p><strong>146 : Once you convert lead, Few fields on lead should be reset so that sensitive information should not be queried using SOQL. How to get this done?<\/strong><br \/>\n<strong> Ans :<\/strong> Once lead is converted, its READ ONLY. we cannot update it using Apex or Trigger. However we can use &#8220;Before Update&#8221; trigger on lead and check for fiels &#8220;<strong>IsConverted<\/strong>&#8220;. If its true means lead is going to be converted so reset all fields in that case.<\/p>\n<hr \/>\n<p><strong>147 : How to convert carriage returns in Textarea to Line Breaks in Visualforce?<\/strong><br \/>\n<strong> Ans :\u00a0<\/strong>We can use &#8220;&lt;apex:outputField&gt;&#8221; instead of &#8220;&lt;apex:outputText&gt;&#8221;. It will maintain formatting automatically.<\/p>\n<hr \/>\n<p style=\"text-align: justify;\"><strong>148 : How to handle comma within field while uploading using DataLoader ?<\/strong><br \/>\n<strong> Ans :<\/strong> Data Loader cannot handle this implicitly because there is no logical path to follow. In case your Data Loader CSV file for import will contain commas for any of the field content, you will have to enclose the contents within double quotation marks &#8221; &#8220;. Data Loader will be able to handle this.<\/p>\n<p style=\"text-align: justify;\">For example :<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nColumn_1__c,Column_2__c,Column_3__c\r\nShiva,&quot;Jitendra, Minal&quot;,Soft\r\n<\/pre>\n<p style=\"text-align: justify;\">If you are creating the import CSV in Excel, the quotation marks will be inserted automatically by Excel whenever a comma is detected in any cell &#8211; Saving the CSV in Excel and opening the same in Notepad reveals the enclosing quotation marks for cells containing commas.<\/p>\n<hr \/>\n<p><strong>149 : In Master Detail Relationship :<\/strong><br \/>\n<strong> OWD for Parent is public Read Only.<\/strong><br \/>\n<strong> If User has &#8211; Create, Edit Permission on Master as well as Detail Object.<\/strong><\/p>\n<p><strong>While creating record for detail object he selects parent record which is not created by him. What will happen in this case ?<\/strong><\/p>\n<p><strong>Ans :<\/strong> He will get an error, because in order to add child record user must have edit permission in parent master record.<\/p>\n<hr \/>\n<p style=\"text-align: justify;\"><strong>150 : Difference in &#8220;Export&#8221; and &#8220;Export All&#8221; in Data Loader in Salesforce?<\/strong><br \/>\n<strong> Ans :<\/strong><br \/>\n<strong>Export :<\/strong> It is used to export the Salesforce Data(excluding recycle bin&#8217;s data) into your local system.<\/p>\n<p style=\"text-align: justify;\"><strong>Export All :<\/strong> \u00a0It is used to export the Salesforce Data(including recycle bin&#8217;s data) into your local system.<\/p>\n<div class=\"intrinsic-container\"><iframe loading=\"lazy\" src=\"https:\/\/jitendrazaa.com\/blog\/SFDCInterviewList.php?num=15\" width=\"300\" height=\"150\" allowfullscreen=\"allowfullscreen\"> <\/iframe><\/div>\n","protected":false},"excerpt":{"rendered":"<p>141 : User Wants to set the starting day in Calendar as &#8220;Monday&#8221; instead of &#8220;Sunday&#8221;. How to get it done? Ans : Change the user locale to &#8220;English ( United Kingdom ) &#8221; in Personal information or User record. 142 : Why CSS is not working in PDF created by Visualforce ? Ans : [&hellip;]<\/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":[9],"tags":[124,331,336],"class_list":["post-3218","post","type-post","status-publish","format-standard","hentry","category-salesforce","tag-interview-questions","tag-salesforce","tag-visualforce"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":4102,"url":"https:\/\/www.jitendrazaa.com\/blog\/salesforce\/salesforce-faq-part-20-lightning-questions\/","url_meta":{"origin":3218,"position":0},"title":"Salesforce interview question related to Lightning framework &#8211; Part 20","author":"Jitendra","date":"February 4, 2015","format":false,"excerpt":"Salesforce interview questions for Salesforce developers and admin , mostly related to newly released Salesforce Lightning components and applications","rel":"","context":"In &quot;Salesforce&quot;","block_context":{"text":"Salesforce","link":"https:\/\/www.jitendrazaa.com\/blog\/category\/salesforce\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":28,"url":"https:\/\/www.jitendrazaa.com\/blog\/salesforce\/salesforce-interview-questions\/","url_meta":{"origin":3218,"position":1},"title":"Salesforce Interview Questions &#8211; Part 1","author":"Jitendra","date":"May 6, 2010","format":false,"excerpt":"Set of most often asked questions on the salesforce.com developement","rel":"","context":"In &quot;Salesforce&quot;","block_context":{"text":"Salesforce","link":"https:\/\/www.jitendrazaa.com\/blog\/category\/salesforce\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":2987,"url":"https:\/\/www.jitendrazaa.com\/blog\/salesforce\/salesforce-interview-questions-part-10\/","url_meta":{"origin":3218,"position":2},"title":"Salesforce Interview Questions \u2013 Part 10","author":"Jitendra","date":"August 2, 2012","format":false,"excerpt":"This Part of Salesforce interview question series depict on browser compatibility issue (Internet Explorer 9) and Visualforce normally for AJAX, Group By and Having Clause. 91. How to add the Document Header in Visualforce page? Ans : Directly there is no way to add the document type in visualforce. However\u2026","rel":"","context":"In &quot;Salesforce&quot;","block_context":{"text":"Salesforce","link":"https:\/\/www.jitendrazaa.com\/blog\/category\/salesforce\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":4618,"url":"https:\/\/www.jitendrazaa.com\/blog\/salesforce\/most-frequently-used-code-snippets-for-salesforce-developers-faq-part-21\/","url_meta":{"origin":3218,"position":3},"title":"Salesforce Developers interview questions &#8211; Most commonly used code snippets &#8211; part 21","author":"Jitendra","date":"July 7, 2015","format":false,"excerpt":"Salesforce interview questions - Most frequently used Apex and visualforce code used by Salesforce developers like \"How to query and abort scheduled job using Apex\", \"Defining VF page as HTML5\", \"Visualforce page as JSON\" , \"Handling colon in element Id for Jquery\" , \"Chatter using Apex\" and many more.","rel":"","context":"In &quot;Salesforce&quot;","block_context":{"text":"Salesforce","link":"https:\/\/www.jitendrazaa.com\/blog\/category\/salesforce\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":2681,"url":"https:\/\/www.jitendrazaa.com\/blog\/salesforce\/salesforce-interview-questions-part-5\/","url_meta":{"origin":3218,"position":4},"title":"Salesforce Interview Questions &#8211; Part 5","author":"Jitendra","date":"January 24, 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":2501,"url":"https:\/\/www.jitendrazaa.com\/blog\/salesforce\/very-useful-tips-and-tricks-of-the-apex-salesforce-interview-questions-part-4\/","url_meta":{"origin":3218,"position":5},"title":"Latest Salesforce Interview Questions &#8211; Part 4 &#8211; Related to Dynamic Apex","author":"Jitendra","date":"November 27, 2011","format":false,"excerpt":"Most Frequently Asked interview questions of Apex, Dynamic Apex, SOSL, Visualforce, SOQL in Salesforce.com SFDC","rel":"","context":"In &quot;Salesforce&quot;","block_context":{"text":"Salesforce","link":"https:\/\/www.jitendrazaa.com\/blog\/category\/salesforce\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/www.jitendrazaa.com\/blog\/wp-json\/wp\/v2\/posts\/3218","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=3218"}],"version-history":[{"count":3,"href":"https:\/\/www.jitendrazaa.com\/blog\/wp-json\/wp\/v2\/posts\/3218\/revisions"}],"predecessor-version":[{"id":4232,"href":"https:\/\/www.jitendrazaa.com\/blog\/wp-json\/wp\/v2\/posts\/3218\/revisions\/4232"}],"wp:attachment":[{"href":"https:\/\/www.jitendrazaa.com\/blog\/wp-json\/wp\/v2\/media?parent=3218"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.jitendrazaa.com\/blog\/wp-json\/wp\/v2\/categories?post=3218"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.jitendrazaa.com\/blog\/wp-json\/wp\/v2\/tags?post=3218"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}