Category Archives: Salesforce

Custom Logout Page in Salesforce

Now you can direct users to a specific logout destination that maintains your own branding experience after they log out of Salesforce.

To enable this follow below steps:
Goto Setup | Administer | Security Controls | Session Settings, navigate to Logout Page Settings section and set the Logout URL of the custom logout page.
salesforce-custom-logout-page-settings

Skype for Salesforce

Skype for Salesforce integrates Salesforce and Skype for Business, so your sales and service reps can send and receive instant messages and see colleague’s availability without leaving Salesforce. If Notes is enabled in your org, reps can also save IM chats as notes and attach them to Salesforce records. Skype for Salesforce is available only if your business has a Microsoft Office 365 Enterprise plan that includes Skype for Business Online, or a Skype for Business Online license.

Note: Skype for Salesforce is available only in Lightning Experience.

From Setup, enter Skype for Salesforce in the Quick Find box, then select Skype for Salesforce.

Enable Skype chat

Create a permission set with Skype Conversation permission enabled, for Skype users and assign it to them.

  • From Setup, enter Permission Sets in the Quick Find box, then select Permission Sets.
  • Either create a permission set or select an existing one.
  • Select System Permissions | Edit.
  • Select the Skype Conversation permission.
  • Click Save.
  • Click Manage Assignments.
  • Select which users you want to give access to Skype for Salesforce.
  • Click Add Assignments.

When Skype for Salesforce is enabled, users who have the Skype Conversation permission see a banner prompting them to sign in to Microsoft Office 365.

Click Connect Office 365 and enter your Office 365 login credentials. After link your Microsoft Office 365 account to Salesforce, you can see who is online and chat.

Get User Browser Information in Lightning Component

We can use $Browser global value provider to get information about the hardware and operating system of the browser accessing the application.

Use $Browser in Lightning Component:

<aura:component>
    {!$Browser.isTablet}
    {!$Browser.isPhone}
    {!$Browser.isIPad}
    {!$Browser.isIPhone}
    {!$Browser.isWindowsPhone}
    {!$Browser.isIOS}
    {!$Browser.isAndroid}
    {!$Browser.formFactor}
</aura:component>

Use $Browser in Lightning JS Controller:

doInit : function(component, event, helper) {
    var device = $A.get("$Browser.formFactor");
    alert("You are using a " + device);
},

Get User $Locale in Lightning Component

The $Locale global value provider returns information about the current user’s preferred locale.

Use $Locale in Lightning Component:

<aura:component  implements="flexipage:availableForAllPageTypes,force:appHostable">
    Language : {!$Locale.language}
    Timezone : {!$Locale.timezone}
    Country : {!$Locale.country}
    Currency : {!$Locale.currency}
</aura:component>

Use $Locale in Lightning JS Controller:

doInit : function(component, event, helper) {
    var locale = $A.get("$Locale.country");
    alert("Your Country " + locale);
},

Salesforce Test Class Data For ContentDocument

Sample Code:

//Create Document
ContentVersion cv = new ContentVersion();
cv.Title = 'Test Document';
cv.PathOnClient = 'TestDocument.pdf';
cv.VersionData = Blob.valueOf('Test Content');
cv.IsMajorVersion = true;
Insert cv;

//Get Content Version
List<ContentVersion> cvList = [SELECT Id, Title, ContentDocumentId FROM ContentVersion WHERE Id = :cv.Id];
System.assertEquals(cvList.size(), 1);

//Get Content Documents
List<ContentDocument> cdList = [SELECT Id, Title, LatestPublishedVersionId FROM ContentDocument];
System.assertEquals(cdList.size(), 1);