Tuesday, October 11, 2016

Winter ‘17 – Lightning Data Services, A Technical primer

Hello Readers and Developers!

Writing this blog after long time - I worked on Lightning Components and Communities extensively in past 1 year. However, there are many new things getting evolved by Salesforce and this blog will be focused on one of that update - Lightning Data Services.

Lightning Data Services - were available before couple of months but in beta mode. However, by Winter '17 Salesforce released it and it is now available in all org with Winter '17 release.

This blog was written for Trekbin, you can visit here to read further - http://www.trekbin.com/winter-17-lightning-data-services-technical-primer/

Please feel free to share your feedback.

Wednesday, December 23, 2015

Spring ‘16 features!!

Hi everyone!
Just wanted to highlight few of the essential and appealing features of Salesforce Spring '16. Most of these are not yet GA but will be available soon and will be ready to use.

  1. Create metadata in bulk using custom metadata loader - check how to use this - https://github.com/haripriyamurthy/CustomMetadataLoader
  2. Global Picklists - http://goo.gl/3qFdnX
  3. Use @future to Avoid the Dreaded MIXED_DML_OPERATION Error in Apex Tests - http://goo.gl/jJBuWj
  4. setCreatedDate method in test class - http://goo.gl/yeHg0H
  5. SandboxPostCopy interface - to run script after a sandbox is created or refreshed - https://goo.gl/F7lKDG
  6. Broadcast Groups in chatter - http://goo.gl/r8LXwI
  7. Access your Box files in Salesforce using Files Connect for Box (Pilot) - http://goo.gl/3vkzga
  8. Use Files without enabling Chatter - http://goo.gl/RVkPjP
  9. Track User Identity Verifications - http://goo.gl/IwmMA1
  10. Wave Application, Wave Dataset components are now available for change sets - http://goo.gl/68SFyI
  11. Reorder criteria in Process Builder using Drag and Drop - http://goo.gl/ab9IC2
  12. DISTANCE() Support with Location-based SOQL Queries - http://goo.gl/6qaOWF

Important links

  1. Salesforce Spring ’16 Release Notes - http://goo.gl/5HCpIm
  2. Sign up for Spring '16 Pre-Release org - https://goo.gl/0LZ87W

Please share your valuable feedback! 

Monday, August 10, 2015

Lightning Desktop - Overview

Salesforce introduced it's mobile version, Salesforce1 in Dreamforce '13. But if you want to survive in this rapidly changing world, you need to be updated!! 
That's what Salesforce following from a decade and so it's still at top of the ladder of CRMs.

Salesforce now came up with its all new sleek, modern interface, drool-worthy Lightning Experience/Lightning Desktop - similar UI for all devices. Lightning Desktop is an entire new face of Saleforce compatible with mobiles, tablets and desktops.

Today, curtains were officially dropped for entire Salesforce family from San Francisco, with a grand event followed by summary from it's stakeholders!

Let's have a look at few revamped screens.

Lightning Desktop Home
Lightning Desktop Home
List View
List View
Opportunity detail layout
Opportunity detail layout
Lead detail layout
Lead detail layout

Lightning Experience will be one of the highlight of DF15 and it will be GA from Oct-15. 

There are many things to share, stay tuned. 

Monday, April 22, 2013

Access all the fields of a related object instantly after insert.

Hi guys, few days back while writing test code for my class I found a weird problem with an awesome solution.

The scenario was, I have inserted an Account 'My Company' and on next line inserting Contact associating it with this Account 'My Company' by just providing an Account id of an Account 'My Company'.

Now, I was expecting when I debug an Contact.Account.Name I will get 'My Company' but was surprised to see 'Null' because, I have already linked my Contact to an Account. I was getting Account Id of that Account in debug then why I can't access Account Name or any other Account field except Id.

To check this out, just paste the below code in your developer console:

 Account objAccount = new Account( Name = 'My Company',  
                                   Website = 'www.mycompany.com'  
 insert objAccount;
   Contact objContact = new Contact( FirstName = 'Praful',                                    LastName = 'Gadge',                                    AccountId = objAccount.Id                                    );   insert objContact;
    //objContact.Account = objAccount;
   system.debug('----objContact.AccountId----'+objContact.AccountId);   system.debug('----objAccount.Name----'+objAccount.Name);   system.debug('----objContact.Account.Name----'+objContact.Account.Name); 

After digging for many hours we got an answer that we have only assigned AccountId to an Contact.AccountId but all other fields of that Account are not yet connected/related to Contact. To connect all fields of a Contact to the Account we can directly associate an object to the related object, like:

objContact.Account = objAccount;

Now we can access all the fields of an Account. To check this uncomment a commented line in the above code.

It means we can associate a whole object to a related object to access all its fields instantly after an insert DML.

Sunday, March 31, 2013

Remove buttons from Rich Text Area

Remove Buttons from Rich text area

We can find so many blogs to add buttons in Rich Text Area, but when I googled for removing particular button from Rich Text Area I found that there is no one who had posted or knows this.

So here it comes, the solution:
  • Basically I am going to use is JavaScript
  • Using this I am gonna hide those button elements from RTA
  • As you can see the JS, I am calling the function onLoad and searching for element 'cke_9'. It's nothing  but the HTML element Id of button
  • If on load also we gets the element as null, we will call this function after 10 Seconds until we find the button/RTA
  • Then, once we get that button we can make particular button invisible.

Include this JavaScript in your Visualforce page at bottom:
     function removeToolbar(){  
       if(document.getElementById('cke_9') != null)  
         //hideEle('cke_6'); //Undo and Redo  
         hideEle('cke_9'); //Bold, Italic, Underline, StrikeThrough  
         hideEle('cke_14'); //Link, Image  
         hideEle('cke_17'); //Allign Buttons(Left, Center, Right)  
         hideEle('cke_21'); //Bullet and indent buttons  
         setTimeout(removeToolbar, 1000);  
   , 1000);  
 function hideEle(eleId)  
      if(document.getElementById(eleId) != null )  
          document.getElementById(eleId).style.display = 'none';  

  • Someone must be confused about how to get button Ids?
    • If we look at attached screenshot, can easily identify the Id of button we want to remove.
    • Basically there are 5 group of buttons, each group having an distinct Id.
    • If you want to remove particular button just add its number to its group Id.
    • For example:
      • To remove only "Underline" button from second group:
      • We first take its group Id = "cke_9" and then its number in a group 3, so 9 + 3 = 12 so,
        we will pass the "cke_12" to hideEle function

Guys, let me know your feedback on this. As it was much appreciated by end user who were thinking this ain't possible.