Posts

One Button/ Link that works in both Classic and Lightning

Image
Yes, it works. I have recently posted this article related to the lightning predefault link from Spring '20. Using such things will take the users to Lightning, but we might have some old-timers who still wanna stick to classic, so this case they might see two buttons/ two links one for classic and one for lightning, sometimes it gets uglier.... Just when you think that is all bad, you might end up adding or changing field definition or record type...!!! As Homer Says D'Oh! If only you knew how to put all these together, right?!? Turned out we could! We can use URL hacks in Lightning now, and we now know if the user is on classic or lightning using $User.UIThemeDisplayed in your button/ link editor. The only complexity here is, using them both in one big formula... we have to  be really careful about the merge-field expressions... Following the use case from the previous post,  Lightning URL Hacks/ Predefault fields in lightning ,  We dont rea

Lightning URL Hacks/ Predefault fields in lightning

Image
Remember those days when you showed off the non-code solutions to the clients and felt really awesome with their reactions... and you did this after the demo. .. And we proudly called them URL Hacks... even though its not much of a hack, 😉, it was just passing parameters. But it's all gone with Lightning. Boy, did they hate it when those URL buttons didn't work in lightning? I mean, it was so convenient for the users, defaulting certain fields is what they wanted, they have it on so many related lists. ... And then there were Quick Actions, Salesforce promoted them heavily for replacing custom buttons, javascript buttons etc... But it quite didnt hit the spot, I meant, they were fine. Still they are useful in some places. Then, just to give the users more productive tools, we ended up overriding the new button or creating a custom component etc... We have this force:createRecord actions in aura components, without having to create a lot of code, we can use the e

Using Visual Studio as Force.com IDE, Import code from cloud to VS

Image
Yup, There is no escaping now, you have to learn to do it with VS Code. I hate and love Salesforce for this. It's like OnePlus' slogan #NeverSettle Here is a new way to get the metadata components from salesforce instances and it is part of the Visual studio experience.  If you are here just to learn How-to, skip the following blabbering and start with "Steps to get metadata from your Salesforce Org.". I liked using eclipse, it was clumsy but still easy to use, it had all the options. Its not just that, we have some more options, chrome extension,  Salesforce Inspector ,  RIP - MavensMate and many more. Everyone has their own favorite. With all the changes in the development on the new platform, I guess we have to get used to the recommended approach, which is Visual Studio, VS Code.  There is actually more to this story, a propaganda. We are required to go through these items, in the name of FUN, COOL, WOW, where are these could be as easy as "

Keyboard Shortcuts for Lightning Experience

Image
Here is a story about how my daughter taught me shortcuts in lightning: My daughter is Six, She was doing her drawing on my laptop, drag 'n drop, coloring all that jazz. I was with a bluetooth keyboard and she didnt know that. I was simply clicking 'Esc' for everything she was dragging. I have my fun doing that, after some time I give her big devil laugh, then she realised that I was doing something with my keyboard. Few days later, I was editing a record in lightning and suddenly the 'Edit modal dialog' disappeared, I didnt know what happened, and tried to do it again, it went off again then I heard a little devil laugh from behind, when I looked at her she was clicking the 'Esc' key on the bluetooth keyboard. Then I went to get her, of course she is smart and she kept her distance, screamed, ran, locked me inside my room. Then I realised, service console has these shortcuts, did they make it available for lightning now? Then I found this article..

Lightning spinner inside Button

I just came across this idea when I looked at some of the standard components by salesforce, for some reason they look way cooler. I thought of sharing this with you... We many a times try to use the spinner different ways, like, on the entire component, by blurring the whole area out, when I compare salesforce's components, they don't ALWAYS do that, they just show the spinner somewhere at the bottom/ top or just next to the button or disabling / replacing the button etc... Well, when I cracked it, it looked amazing. here is a simple component: <aura:component > <aura:attribute name="boooo" type="boolean" default="false"/> <lightning:buttonGroup> <lightning:buttonIcon iconName="utility:email" variant="brand" disabled="{!v.boooo}" onclick="{! c.handleClick }" alternativeText="Click to send Email" /> <lightning:button variant="brand" title

Top 10 Cool Things I like in Salesforce Summer 18

Image
I like Summer updates as Salesforce always sets the ground up for next Dreamforce.  In this article I will not be summarizing the summer 18 for you, I will only be talking about the things I like as a developer/ architect and end user, it could be as little as a datetime method 😉 . Mostly I will be covering lightning experience, Sales, Service, Platform, Communities and Einstein. 10. URL Change : (Straight out from the release notes) The new URL format is more readable, addressing the issue of being directed to an unexpected location when accessing Lightning Experience URLs before authenticating. Here are some examples of the new format. Object Home page Previous format:  https://<lightning.domain.com>/one/one.app/#/sObject/Account/home New format:  https://<lightning.domain.com>/lightning/o/Account/home Record page Previous format:  https://<lightning.domain.com>/one/one.app#/sObject/006R000000245p1IAA/view New format:  https://<lightning.

Nested AURA:IFs in Lightning Components Salesforce

Image
You can use use the nested IFs on the framework. Go to Developer Console>>New>>Lightning Application Give it a name, Submit Here is a sample code: <aura:application >  <aura:iteration items="1,2,3,4,5" var="item">  Iteration {!item} -  <aura:if isTrue="{!item=='1'}"> <b>In The First IF </b> <br/> <aura:set attribute="else"> <aura:if isTrue="{!item=='2'}"> <b>In The Second IF </b> <br/> <aura:set attribute="else"> <aura:if isTrue="{!item=='3'}"> <b>In The Third IF </b> <br/> <aura:set attribute="else"> <aura:if isTrue="{!item=='4'}">