{"id":6252,"date":"2017-09-17T21:16:28","date_gmt":"2017-09-17T21:16:28","guid":{"rendered":"http:\/\/www.jitendrazaa.com\/blog\/?p=6252"},"modified":"2017-09-17T21:16:28","modified_gmt":"2017-09-17T21:16:28","slug":"salesforce-path-read-only-lightning-component","status":"publish","type":"post","link":"https:\/\/www.jitendrazaa.com\/blog\/salesforce\/salesforce-path-read-only-lightning-component\/","title":{"rendered":"Salesforce Path &#8211; Read Only Lightning Component"},"content":{"rendered":"<p style=\"text-align: justify;\"><a href=\"https:\/\/help.salesforce.com\/articleView?id=rss_sales_path.htm&amp;type=0\">Salesforce Path<\/a> is awesome feature, where you can display picklist value at top of record page and on click, it updates value in Salesforce database. However same solution does not fit in all scenario. Consider situation where picklist field is supposed to be changed by some other process or Integration. Now you don&#8217;t want anyone to change it from user interface. Even though you like Salesforce Path to show summary at top of page however it won&#8217;t be useful in above scenario.<\/p>\n<p style=\"text-align: justify;\">Because of this, I created a\u00a0<strong>Read Only Path Component in Lightning.\u00a0<\/strong>I tried to keep same look and feel as of Standard Path component. This component will need only two inputs<\/p>\n<ol>\n<li style=\"text-align: justify;\"><strong>Record Id<\/strong> &#8211; It would be automatically passed if we use it using App Builder<\/li>\n<li style=\"text-align: justify;\"><strong>Field API Name<\/strong> &#8211; API name of picklist type of field<\/li>\n<\/ol>\n<p style=\"text-align: justify;\">Now think about it. Only thing I got is Record Id. How would I know Object Name ? How would I know all picklist values for field name supplied ?<\/p>\n<p style=\"text-align: justify;\">\u00a0With the help of <a href=\"https:\/\/www.jitendrazaa.com\/blog\/salesforce\/salesforce-interview-question-part-12\/\">this post, I will get Object name on basis of record Id<\/a>. \u00a0And, with the <a href=\"https:\/\/www.jitendrazaa.com\/blog\/salesforce\/very-useful-tips-and-tricks-of-the-apex-salesforce-interview-questions-part-4\/\">help of this post<\/a>, I will get Field Description. Hopefully you got it, I am talking about <strong>Dynamic Apex<\/strong> here \ud83d\ude42 .<\/p>\n<p><!--more--><\/p>\n<p>Below animation shows how to configure and use this component.<\/p>\n<figure style=\"width: 984px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.jitendrazaa.com\/blog\/wp-content\/uploads\/2017\/09\/Chevron-Lightning-Component-Salesforce.gif?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"size-large\" src=\"https:\/\/i0.wp.com\/www.jitendrazaa.com\/blog\/wp-content\/uploads\/2017\/09\/Chevron-Lightning-Component-Salesforce.gif?resize=984%2C900&#038;ssl=1\" alt=\"Read only Path (Chevron) Component in Salesforce Lightning\" width=\"984\" height=\"900\" \/><\/a><figcaption class=\"wp-caption-text\">Read only Path (Chevron) Component in Salesforce Lightning<\/figcaption><\/figure>\n<p><strong>Source Code :<\/strong><\/p>\n<p><script src=\"https:\/\/gist.github.com\/JitendraZaa\/7c2ea7153622ca55c6e6cac2efc9222e.js\"><\/script><\/p>\n<p>You can use below code snippet to test this component without App builder.<\/p>\n<p><script src=\"https:\/\/gist.github.com\/JitendraZaa\/0e5689f39e4e7b5df589f4caaedd036b.js\"><\/script><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Chevron Component build in Lightning with Same look and feel as of Salesforce Path in read only mode<\/p>\n","protected":false},"author":1,"featured_media":6255,"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":[311],"class_list":["post-6252","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-salesforce","tag-lightning-component"],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/www.jitendrazaa.com\/blog\/wp-content\/uploads\/2017\/09\/Chevron-Lex-Component.gif?fit=944%2C88&ssl=1","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":5070,"url":"https:\/\/www.jitendrazaa.com\/blog\/salesforce\/dependent-picklist-in-salesforce-flow-using-custom-metadata-type-video\/","url_meta":{"origin":6252,"position":0},"title":"Dependent picklist in Salesforce flow using Custom Metadata type &#8211; Video","author":"Jitendra","date":"December 7, 2015","format":false,"excerpt":"Salesforce flow is great alternative for Visualforce pages used by admin. I have written, multiple blog post on Salesforce flow already and in this post we will discuss how we can create dependent picklist in Flow. If you are already using flow, might know that creating dependent picklist is not\u2026","rel":"","context":"In &quot;Salesforce&quot;","block_context":{"text":"Salesforce","link":"https:\/\/www.jitendrazaa.com\/blog\/category\/salesforce\/"},"img":{"alt_text":"Salesforce flow - Dependent picklist output","src":"https:\/\/i0.wp.com\/www.jitendrazaa.com\/blog\/wp-content\/uploads\/2015\/12\/Salesforce-flow-Dependent-picklist-output.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":4942,"url":"https:\/\/www.jitendrazaa.com\/blog\/salesforce\/salesforce-winter-16-top-features\/","url_meta":{"origin":6252,"position":1},"title":"Salesforce Winter 16 &#8211; Top features","author":"Jitendra","date":"October 28, 2015","format":false,"excerpt":"You can watch recording of my live stream channel as well to know more on Winter 16 features.\u00a0Powerpoint presentation used in livestream can be accessed from here. 1. Object Manager Objects are objects, even if they are standard or custom objects. Salesforce simplified navigation to access Objects, we can access\u2026","rel":"","context":"In &quot;Salesforce&quot;","block_context":{"text":"Salesforce","link":"https:\/\/www.jitendrazaa.com\/blog\/category\/salesforce\/"},"img":{"alt_text":"Setup Audit Trail - Salesforce Winter 16","src":"https:\/\/i0.wp.com\/www.jitendrazaa.com\/blog\/wp-content\/uploads\/2015\/10\/Setup-Audit-Trail.jpg?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.jitendrazaa.com\/blog\/wp-content\/uploads\/2015\/10\/Setup-Audit-Trail.jpg?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.jitendrazaa.com\/blog\/wp-content\/uploads\/2015\/10\/Setup-Audit-Trail.jpg?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/www.jitendrazaa.com\/blog\/wp-content\/uploads\/2015\/10\/Setup-Audit-Trail.jpg?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":5949,"url":"https:\/\/www.jitendrazaa.com\/blog\/salesforce\/state-country-picklist-in-salesforce-supporting-alpha-3-iso-code\/","url_meta":{"origin":6252,"position":2},"title":"State &#038; Country picklist in Salesforce supporting Alpha-3 ISO code","author":"Jitendra","date":"March 22, 2017","format":false,"excerpt":"How to use Integration Value in State & Country picklist in Salesforce","rel":"","context":"In &quot;Salesforce&quot;","block_context":{"text":"Salesforce","link":"https:\/\/www.jitendrazaa.com\/blog\/category\/salesforce\/"},"img":{"alt_text":"State & Country Picklist in Salesforce","src":"https:\/\/i0.wp.com\/www.jitendrazaa.com\/blog\/wp-content\/uploads\/2017\/03\/State-Country-Picklist-in-Salesforce-1024x299.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.jitendrazaa.com\/blog\/wp-content\/uploads\/2017\/03\/State-Country-Picklist-in-Salesforce-1024x299.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.jitendrazaa.com\/blog\/wp-content\/uploads\/2017\/03\/State-Country-Picklist-in-Salesforce-1024x299.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/www.jitendrazaa.com\/blog\/wp-content\/uploads\/2017\/03\/State-Country-Picklist-in-Salesforce-1024x299.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":6877,"url":"https:\/\/www.jitendrazaa.com\/blog\/salesforce\/get-picklist-values-in-apex\/","url_meta":{"origin":6252,"position":3},"title":"Get Picklist Values in Apex","author":"Jitendra","date":"August 22, 2017","format":false,"excerpt":"Code snippet of reading Picklist values in Salesforce Apex","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":5109,"url":"https:\/\/www.jitendrazaa.com\/blog\/salesforce\/lightning-component-for-wikipedia-search\/","url_meta":{"origin":6252,"position":4},"title":"Lightning Component for Wikipedia search","author":"Jitendra","date":"January 6, 2016","format":false,"excerpt":"Initially I thought creating Wikipedia Search component will be straight forward. I can simply use AJAX request from Lightning component to get result from Wikipedia using its REST API. Soon, I discovered about Content Security Policy\u00a0in Lightning components developer guide. If we attempt to use AJAX or REST API in\u2026","rel":"","context":"In &quot;Salesforce&quot;","block_context":{"text":"Salesforce","link":"https:\/\/www.jitendrazaa.com\/blog\/category\/salesforce\/"},"img":{"alt_text":"Salesforce Lightning Component for Wikipedia Search","src":"https:\/\/i0.wp.com\/www.jitendrazaa.com\/blog\/wp-content\/uploads\/2016\/01\/Salesforce-Lightning-Component-for-Wikipedia-Search.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.jitendrazaa.com\/blog\/wp-content\/uploads\/2016\/01\/Salesforce-Lightning-Component-for-Wikipedia-Search.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.jitendrazaa.com\/blog\/wp-content\/uploads\/2016\/01\/Salesforce-Lightning-Component-for-Wikipedia-Search.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/www.jitendrazaa.com\/blog\/wp-content\/uploads\/2016\/01\/Salesforce-Lightning-Component-for-Wikipedia-Search.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":4646,"url":"https:\/\/www.jitendrazaa.com\/blog\/salesforce\/compliation-of-resources-to-learn-lightning-components-in-salesforce\/","url_meta":{"origin":6252,"position":5},"title":"Compilation of resources to learn Lightning Components in Salesforce","author":"Jitendra","date":"July 8, 2015","format":false,"excerpt":"An attempt to gather all resources to learn Salesforce lightning component in one blog post","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\/6252","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=6252"}],"version-history":[{"count":6,"href":"https:\/\/www.jitendrazaa.com\/blog\/wp-json\/wp\/v2\/posts\/6252\/revisions"}],"predecessor-version":[{"id":6262,"href":"https:\/\/www.jitendrazaa.com\/blog\/wp-json\/wp\/v2\/posts\/6252\/revisions\/6262"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.jitendrazaa.com\/blog\/wp-json\/wp\/v2\/media\/6255"}],"wp:attachment":[{"href":"https:\/\/www.jitendrazaa.com\/blog\/wp-json\/wp\/v2\/media?parent=6252"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.jitendrazaa.com\/blog\/wp-json\/wp\/v2\/categories?post=6252"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.jitendrazaa.com\/blog\/wp-json\/wp\/v2\/tags?post=6252"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}