Sep 14, 2016

Winter 17 sneak peak - Lightning Lovers

Winter 17 is here and we all are excited about it!

Here are some new features which I like when I took a glimpse on release notes.

-> Lightning navigation Menu is changed from vertical to Horizontal.




 
-> All custom apps created in classic view will be supported. But now their description is also available so we might need to add description in missing apps so that they look good and this is an optional step.


-> After your users create, edit, or clone a record in Lightning Experience, they can create another record using the Save & New button. The Save & New button lets users create records repeatedly without leaving their spot in the app.

-> Field Level help is now available in Lex and SF1


-> You can no take ownership of multiple lead at once. From the queue list view, your reps can select all the leads (up to 200). When they click Accept, they’re committed and those leads become theirs. 

->  Global picklist now available in Lightning experience and we can now send them with change set from Sandbox to production.
-> Now the Open CTI is available in Lex. In the bottom you can access the CTI.

-> Your code can use merge fields to construct the bodies of Apex callouts to named credential–defined endpoints. Those merge fields now support the HTMLENCODE function so you can escape special characters, such as underscore (_) and ampersand (&), in the merge fields in callout bodies.
HTMLENCODE is an existing formula function. Other formula functions aren’t supported, and you can’t use HTMLENCODE on merge fields in HTTP headers.

Example

The following example escapes special characters in credentials.
req.setBody('UserName:{!HTMLENCODE($Credential.Username)}')
req.setBody('Password:{!HTMLENCODE($Credential.Password)}')

-> Record Details Tab Never Forgets in Lightning Experience

When your users expand or collapse a section in record details in Lightning Experience, the section stays that way even after visiting other areas in Salesforce. This change helps users scroll through a record faster, showing only the information they care about.
For example, in Lead details, a user collapses the Address Information section and expands the Additional Information section. The next time the user views a lead’s details with the same layout, those sections remain collapsed and expanded, respectively.




-> Confirmation messages that appear after your users create, edit, delete, or clone a record successfully from a related list in Lightning Experience and Salesforce1 have changed. The messages include the record name for more context. Also, after your users create a record from a related list in Lightning Experience (not Salesforce1), the popup message includes a link to the record for easy navigation.

-> Navigate from a Lightning Component to Another (Beta)

To navigate from a Lightning component to another, specify the component name using componentDef. This example navigates to a component c:myComponent and sets a value on the contactName attribute.


navigateToMyComponent : function(component, event, helper) { varevt = $A.get("e.force:navigateToComponent"); evt.setParams({ componentDef : "c:myComponent", componentAttributes: { contactName :component.get("v.contact.Name")             }         }); evt.fire();     }

-> Opportunity owner can edit the probability of the opportunity without switching in the Salesforce Classic view.

-> The time window to quick-deploy your validations has expanded from 4 days to 10 days.

-> Apex test suites are now accessible through the Metadata API, using the ApexTestSuite type. You no longer need to recreate test suites in each of your testing orgs. Instead, create an Apex test suite once and deploy it and its test classes to each of your test environments. Now you can focus on more important things, like whether to call your new test methodwhatTheHeckIsWrongHere() or pleasePleasePleaseReturnTrue().

If there are any which you like the most, please list them as comment.

Happy Winter 17!

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!!