Sep 6, 2016

Lightning experience OR classic view, where am I?

Have you ever faced a problem of identifying in which experience user is opening your page (VFP)? Is it lightning or classic.



Well, here is the solution to it. There are two ways :

1) Via Apex

public boolean isLightningExperience()
{
 if(Apexpages.currentPage().getParameters().get('sfdcIFrameOrigin') != null)
        return true;
 return false;
}

2) Via JS on visualforce page

function isLightningExperience()
{
  if('{!$Currentpage.parameters.sfdcIFrameOrigin}' != '')
  return true;
  return false;
}

You can use two parameters to check this 'sfdcIFrameOrigin' and 'istdp'. Now you can easily identify in which experience the user is via your code and can manipulate the functionality accordingly. 

Happy Coding!!

76 comments:

  1. Nice content. Can we handle the override thing by this ? Suppose we have override the edit button og an object with a vf and i need to show a different lightning component for editing while using lightning experience.

    ReplyDelete
  2. your concept is good, but i have one doubt then how we can write in Soql module can you please explain it.



    Salesforce Training in Chennai

    ReplyDelete
  3. very nice and informative article and useful blog, thank you for sharing with us keep posting
    salesforce training,salesforce online training,online salesforce training

    ReplyDelete
  4. Thanks a lot for offering great informative post. Really liked this awesome post.

    Salesforce Implementation Services

    ReplyDelete
  5. Very informative blog thank you for sharing with us , keep posting learn more about
    salesforce training,salesforce online training

    ReplyDelete
  6. I need a brief explanation coding ,Your simple informative is valuable but not enough for me that i want to know the variations on salesforce classic and lightening experience.



    Salesforce Training in Chennai

    ReplyDelete
  7. This is very informative blog and useful article thank you for sharing with us keep posting more details aboutsalesforce training,salesforce online training

    ReplyDelete
  8. This is very informative blog and nice article , I really like your technique of writing a blog. I book marked it to my bookmark site list and will be checking back in the near future.Salesforce training, salesforce online training

    ReplyDelete

  9. very usefull informatation.and iam looking for more posts like this please keep updating us........

    ReplyDelete
  10. Thank you for your information. It was very easy to understand. You are expressing it in easy way. The images are very helpful. A very useful blog on lightning protection System, I am having this device in my home and also at my office.

    ReplyDelete
  11. This is very useful informative blog.Thanks for shairng information.To get the details about
    Central Government jobs TamilNadu state 2017-18

    ReplyDelete
  12. Nice information thanks for sharing good blogs.More information Visit
    Krishna University Result

    ReplyDelete
  13. This comment has been removed by the author.

    ReplyDelete
  14. Brilliant, One of the best example and code for knowing the user experience and intensive of having the lightning experience or classic view, As I prefer is Classic View because it has the specific importance of having the user experience easy and well understandable As I completed my PMP Certification in Pune I was having the my PC or other resource as a classic View only Thank you so much for the information and your code Well I look forward for more Updates from you

    ReplyDelete
  15. Boost your career with Salesforce/SFDC on demand CRM, Lightning, world #1 with hands on and scenarios based learning at very much affordable cost. Call-91-9310096831

    ReplyDelete
  16. Really Good blog post.provided a helpful information.I hope that you will post more updates like this salesforce Online Training Hyderabad

    ReplyDelete
  17. These blog is conveys a useful information to viewers. I like your article is nice.

    Selenium Training in Chennai

    ReplyDelete
  18. "• Nice and good article. It is very useful for me to learn and understand easily. Thanks for sharing your valuable information and time. Please keep updating IOT Online Training
    "

    ReplyDelete
  19. Needed to compose you a very little word to thank you yet again regarding the nice suggestions you’ve contributed here.
    I have read your blog its very attractive and impressive. I like it your blog.
    simultaneous interpretation booth

    silent disco headphones

    silent disco headphones
    silent disco headphones
    simultaneous interpretation equipment

    simultaneous interpretation equipment

    bosch simultaneous interpretation system

    ReplyDelete
  20. thank you for sharing such a nice and interesting blog with us. i have seen that all will say the same thing repeatedly. But in your blog, I had a chance to get some useful and unique information. I would like to suggest your blog in my dude circle. please keep on updates. hope it might be much useful for us. keep on updating.
    Salesforce Training in Chennai
    German Classes in Chennai
    Salesforce crm Training in Chennai
    Salesforce administrator training in chennai
    best german classes in chennai
    German language training in chennai

    ReplyDelete
  21. Hey Really Thanks for sharing the best information regarding oracle,hope you will write more great blogs.
    Oracle Fusion Financials Online Training

    ReplyDelete
  22. Thank you for sharing wonderful information with us to get some idea about that content. check it once through
    Machine Learning With TensorFlow Training and Course in Tel Aviv
    | CPHQ Online Training in Beirut. Get Certified Online

    ReplyDelete
  23. Hi, Thanks for sharing nice information about lighting. It is useful contant. Anyhave interest to learn Digital Marketing Course in Ameerpet . Best institutes is Hyderabad Digital Marketing Institutes they all concepts SEO,SMM,SMO ADwords, Affilated Marketing.

    ReplyDelete
  24. Great post and informative blog.it was awesome to read, thanks for sharing this great content to my vision.

    CEH Training In Hyderbad

    ReplyDelete
  25. Hello! I just wish to give an enormous thumbs up for the nice info you've got right here on this post. I will probably be coming back to your weblog for more soon! học ielts hà nội

    ReplyDelete
  26. This comment has been removed by the author.

    ReplyDelete
  27. Good to see such blog information very excited
    Sanjary Kids is one of the best play school and preschool in Hyderabad,India. The motto of the Sanjary kids is to provide good atmosphere to the kids.Sanjary kids provides programs like Play group,Nursery,Junior KG,Serior KG,and provides Teacher Training Program.We have the both indoor and outdoor activities for your children.We build a strong value foundation for your child on Psychology and Personality development.
    Preschool in hyderabad

    ReplyDelete
  28. Nice posting blog information
    Best QA / QC Course in India, Hyderabad. sanjaryacademy is a well-known institute. We have offer professional Engineering Course like Piping Design Course, QA / QC Course,document Controller course,pressure Vessel Design Course, Welding Inspector Course, Quality Management Course, #Safety officer course.
    QA / QC Course in India

    ReplyDelete

  29. Thanks for sharing useful information.. we have learned so much information from your blog..... keep sharing
    Oracle Fusion HCM Online Training

    ReplyDelete
  30. Nice Article
    Best QA / QC Course in India, Hyderabad. sanjaryacademy is a well-known institute. We have offer professional Engineering Course like Piping Design Course, QA / QC Course,document Controller course,pressure Vessel Design Course, Welding Inspector Course, Quality Management Course, #Safety officer course.
    QA / QC Course
    QA / QC Course in india
    QA / QC Course in hyderabad

    ReplyDelete
  31. I just loved your article on the beginners guide to starting a blog.If somebody take this blog article seriously in their life, he/she can earn his living by doing blogging.thank you for thizs article. TOP blockchain online training

    ReplyDelete
  32. This is most informative and also this post most user friendly and super navigation to all posts. Thank you so much for giving this information to me.salesforce developer training in bangalore

    ReplyDelete
  33. Nice post. Thanks for sharing! I want people to know just how good this information is in your blog. It’s interesting content and Great work.
    machine learning courses
    data science course in hyderabad
    business analytics courses in hyderabad

    ReplyDelete
  34. If you are stuck with your Management assignment then in this case you can opt for our Management Assignment. we provide the bestOnline home work.We also provideLeadership Assignment Help for students across the globe. for more information contact us +16692714848.

    ReplyDelete

  35. Fantastic blog. Great piece of information. Very informative. This is truly a great read for me. I have bookmarked it and I am looking forward to reading new articles. Thanks for sharing this with us.
    Today For Website and Mobile Apps website development company in delhi
    ecommerce website development company in delhi

    ReplyDelete
  36. I'm glad to locate this say very mind blowing and cheerfully for everyone. That's Great & Giving so much different subjects information after reading your articles. Really I am heartily agreed with this article and, Thanks and share more. assignment help in australia -
    Assignment Help Melbourne -
    Assignment Help Perth

    ReplyDelete
  37. That's an incredibly useful post. Thanks alot for your afforts. I would be glad If you get time to read my article. Thanks in advance
    Anaplan Training

    ReplyDelete
  38. Thank you for taking the time and sharing this information with us. It was indeed very helpful and insightful while being straight forward and to the point.

    AWS cloud training in Gurgaon
    FullStack Development Training in Gurgaon
    Angularjs Training in Gurgaon

    ReplyDelete
  39. here you can get more information about joining the pakistan navy
    https://joinpaknavy.site/

    ReplyDelete
  40. Thanks for the best blog ever about salesforce training

    We provide the best anaplan training in india with best & experienced faculty and also real time projects included

    ReplyDelete
  41. Do you need help with academic writing services online? Our best online assignment writers offer assignment help online.

    ReplyDelete
  42. Looking for a professional for your Coursework help then we are just a click away, visit our website and get the best help for your Coursework writing at a very cost effective price.

    ReplyDelete
  43. I really appreciate the kind of topics you post here. Thanks for sharing us a great information that is actually helpful. Good day!

    DevOps Training in Hyderabad

    ReplyDelete


  44. Hi, thankful for your shared and valuable story for making the smartness in the relative subject. Over time, I triode to read different subject. I am interested to feel free to subscribe your new post. I highly urge to take our service and connect us to Assignment Help .

    ReplyDelete
  45. Wow! This was an incredibly wonderful post. Many thanks for providing these details. will be sent or send

    ReplyDelete
  46. Your website helps me a lot in my work. I am also a web developer like you but my website is aimed at entertainment with fun games. Click the link below to go to my site and explore it.

    friday night funkin download

    fnf download download

    ReplyDelete
  47. Assignment help is the best way to get your work done on time. The task of writing an assignment can be difficult, especially if you are not good at writing. You may find it hard to come up with a thesis statement or even know where to start. The best way to get your assignment done on time is to Buy assignment professional help from expert writers.

    ReplyDelete
  48. Stop thinking where to hire essay writing service Malaysia and go to Malaysiaassignmenthelp.com for the best essay writing service and have your essays completed by expert academic writers in the correct format.

    ReplyDelete
  49. تنفرد شركة انجزني كبري شركات نقل الاثاث في مصر بعدد العمالة التي تقوم بعملية تغليف الاثاث على أكمل وجه، فلن تكون بحاجة للتواصل مع أحد الشركات المتخصصة في بيع الكراتين وتنفق كثير من الأموال حول جلب أنواع من المواد الخاصة بالتغليف، فكل ما يمكنك فعله هو التواصل مع شركة انجزني الشركة الرائدة في هذا المجال التي تتيح لك خدمة نقل وتغليف ممتازة.

    ReplyDelete
  50. تفاوت أسعارونش رفع اثاث  من شركة لأخرى، هذا بالإضافة إلى اختلاف التكلفة تبعا للأدوار التي يصل إليها الونش، لكن اذا اردت ان تحصل علي اقل تكلفة تعامل مع شركة السلطان لانها الافضل والارخص في المجال علي الاطلاق.

    ReplyDelete
  51. The Spanish Group se caracteriza por ser uno de los líderes nacionales en servicios de traducción de textos en inglés y español. The Spanish Group ofrece traducir documento de español a inglés como en otros 90 idiomas para todas las necesidades de traducción profesional y certificada.

    ReplyDelete