Salesforce Chatter Answers to Retire in Winter ’18

With the Winter ’18 release, Salesforce will no longer support Chatter Answers, and users of Chatter Answers will no longer be able to post, answer, comment, or view any of the existing Chatter Answers data. Customers will have until the Winter ’18 release to complete their transition to Chatter Questions.

Chatter Answers is a Questions and Answer (Q&A) feature that allows users to post questions and receive answers and comments from other users or support agents. The functionality is used within portals, Communities, or internally as a separate object within your Salesforce org.

NOTE: Chatter Answers is unavailable for new orgs created with or after the Summer ’16 release. Such customers will need to use Chatter Questions.

Check the below link for more information

https://help.salesforce.com/articleView?id=Chatter-Answers-to-Retire-in-Winter-18&type=1

Cheers!!!

How to use custom fields on Add Opportunity Splits page?

1. Go to Opportunity Split --> Fields.


2. Click New and create a custom field.

3. Go to Opportunity Split --> Page Layouts.


4. Edit a layout and select Edit Multi-Line Layout.


5. Add the field and Save it.


Output:


Cheers!!!

How to redirect user to record detail page from Visualforce page in Salesforce Console?

Sample Code:

public PageReference redirect() { 
    String acctId = ApexPages.currentPage().getParameters().get('acc');
    PageReference pr = new PageReference('salesforce_url/console#%2F' + accId);
    return pr; 
}

Cheers!!!

Salesforce Console Integration Toolkit

The Salesforce console is designed for users in fast-paced environments who need to find, update, and create records in Salesforce quickly. The Salesforce Console Integration Toolkit provides you with programmatic access to the Salesforce console so that you can extend it to meet your business needs. With the Salesforce Console Integration Toolkit, you can open and close tabs in the console to streamline a business process. For example, the toolkit lets you integrate third-party systems with the console, opening up an external application in the same window, in a tab.

1. Create a Visualforce page with the below code.

Sample Visualforce page:

<apex:page standardController="Case">

    <apex:includeScript value="/support/console/39.0/integration.js"/>
    <script type="text/javascript">
        /* Opens Case's Contact in primary tab */
        function openPrimaryTab() {
            sforce.console.openPrimaryTab(undefined, 
            '{!$Site.BaseUrl}/{!Case.Contact.Id}', true, 'Contact');
        }

        /* Opens Case's Contact in sub tab */
        var callOpenSubtab=function callOpenSubtab(result) {
            sforce.console.openSubtab(result.id, 
            '{!$Site.BaseUrl}/{!Case.Contact.Id}', true, 'Contact');
        };

        function openSubtab() {
            sforce.console.getEnclosingPrimaryTabId(callOpenSubtab);
        }

        //Sets the title of the current tab to "Example"
        function setTitle() {
            sforce.console.setTabTitle('Example');
        }

        //The callback function that closeTab will call once it has the ID for its tab
        var callCloseTab= function callCloseTab(result) {
            sforce.console.closeTab(result.id);
        }

        function closeTab() {
            sforce.console.getEnclosingTabId(callCloseTab);
        }
    </script>

    <A HREF="#" onClick="openPrimaryTab();return false">Open A Primary Tab</A> 
    <p/><A HREF="#" onClick="openSubtab();return false">Open A Subtab</A> 
    <p/><A HREF="#" onClick="setTitle();return false">Set Title to Example</A> 
    <p/><A HREF="#" onClick="closeTab();return false">Close This Tab</A> 

</apex:page>

2. Go to Buttons, Links, and Actions under Case.


2. Click "New Button or Link".


3. Save it.


4. Add it to the Case page layout.


5. Open a Case record and Click the link.


Set Title to Example:


Open A Subtab:


Open A Primary Tab:


Cheers!!!

How to query all private reports in Salesforce

Use the below query to query all private reports in Salesforce.

Sample SOQL:

SELECT Id, Name, Owner.Name FROM Report USING SCOPE allPrivate

To know more about USING SCOPE, check the below link

https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_select_using_scope.htm

Cheers!!!

Sample Apex Code for call out with oAuth token

Sample Code:

        HTTP h = new HTTP();
        HTTPRequest req = new HTTPRequest();
        req.setEndPoint('<Enter Endpoint URL>');
        req.setMethod('GET');
        req.setHeader('Authorization', 'Bearer <Enter Token>');
        HTTPResponse res = h.send(req);            
        String str = res.getBody();

Cheers!!!

Team Explorer in Microsoft Visual Studio 2017

1. Go to the below link to download Visual Studio 2017 Enterprise.

https://www.visualstudio.com/downloads/

2. Install it.

3. Click Launch.


4. Go to Team - > Manage Connections...


5. Click Manage Connections.


6. Click Add.

7. Enter the URL and click "Add".

8. Select the Collection.

9. Click "Connect" button.

Cheers!!!

Unable to login as other user in Salesforce?

1. Under "Administer," select Security Controls --> Login Access Policies.

2. Select Administrators Can Log in as Any User.


Note:
If Administrators Can Log in as Any User is not found, contact Salesforce.com support.

Check the below link for more information

https://help.salesforce.com/articleView?id=Enabling-Organization-Admins-Can-Login-as-Any-User&type=1

Cheers!!!

How to delete files attached to FeedItem after deleting FeedItem in Salesforce?

Sample Code:

Set < Id > setContentVerIds = new Set < Id >();
for ( FeedItem FI : [ SELECT Id, RelatedRecordId FROM FeedItem ] ) { 
        //Add your required where condition
if ( String.isNotBlank(FI.RelatedRecordId) )
setContentVerIds.add(FI.RelatedRecordId);//RelatedRecordId is the Content Version Id
}
List < ContentDocument > listFiles = new List < ContentDocument >();
for ( ContentVersion CV : [ SELECT Id, ContentDocumentId FROM ContentVersion WHERE Id IN: setContentVerIds ] )
listFiles.add(new ContentDocument(Id = CV.ContentDocumentId));
if ( listFiles.size() > 0 )
delete listFiles;

Cheers!!!

How to delete files attached to FeedComment after deleting FeedIComment in Salesforce?

Sample Code:

Set < Id > setContentVerIds = new Set < Id >();
for ( FeedComment FC : [ SELECT Id, RelatedRecordId FROM FeedComment ] ) { 
        //Add your required where condition
if ( String.isNotBlank(FC.RelatedRecordId) )
setContentVerIds.add(FC.RelatedRecordId);//RelatedRecordId is the Content Version Id
}
List < ContentDocument > listFiles = new List < ContentDocument >();
for ( ContentVersion CV : [ SELECT Id, ContentDocumentId FROM ContentVersion WHERE Id IN: setContentVerIds ] )
listFiles.add(new ContentDocument(Id = CV.ContentDocumentId));
if ( listFiles.size() > 0 )
delete listFiles;

Cheers!!!

Profile Permission to Extract and deploy sharing rules in Salesforce?


Cheers!!!

What’s the Difference Between a Studio and a Builder?

Marketing Cloud studios help you work with marketing “channels,” which map to the ways you communicate with your customers (email, mobile, social, etc). Marketing Cloud builders represent the “platform” or tools that help you build and manage personalized customer journeys.

For example, imagine you want to connect to your customers via email to tell them all about your weekend sale. You use Email Studio to manage your email distribution to your customers. When you’re ready to personalize, automate, and build cross-channel customer journeys, then you add builders. Journey Builder is the Marketing Cloud tool you use to build a cross-channel customer journey, such as connecting with customers via email and mobile.

Cheers!!!

Difference between Marketing Cloud and Pardot?

Let’s start with what’s similar between Marketing Cloud and Pardot—they’re both marketing automation tools. The difference is that Marketing Cloud helps you engage with your customers, or as we call it Business-to-Consumer (B2C), at scale. This means Marketing Cloud can send, push, and analyze a lot of data. Pardot drives sales through target marketing for businesses who sell to other businesses (B2B). Pardot helps you guide prospects through the whole buying campaign.

Cheers!!!

Batch class execute() method not covered by test class

1. Remember that the execute method will be called only once.

2. If you have chained batch classes, create separate methods for each and every batch class.

3. Make sure the start method fetches the required to process in execute method.

Cheers!!!

How to set created date for CollaborationGroupFeed in test class in Salesforce

Sample Test Class:

@isTest
private class CollaborationGroupFeedTest {

    static testMethod void test() {
        CollaborationGroup cg = new CollaborationGroup(Name = 'Test', CollaborationType = 'Public');
        insert cg;
        FeedItem FI = new FeedItem(Body = 'Test', ParentId = cg.Id);
        insert FI;
        CollaborationGroupFeed CGrpFeed = [ SELECT Body, Type FROM CollaborationGroupFeed ];
        system.debug('Output is ' + CGrpFeed);
        Test.setCreatedDate(CGrpFeed.Id, System.now.addMonths(-4));
    }

}

Cheers!!!

CollaborationGroupFeed in Test Class in Salesforce

Sample Test Class:

@isTest
private class CollaborationGroupFeedTest {

    static testMethod void test() {
        CollaborationGroup cg = new CollaborationGroup(Name = 'Test', CollaborationType = 'Public');
        insert cg;
        FeedItem FI = new FeedItem(Body = 'Test', ParentId = cg.Id);
        insert FI;
        system.debug('Output is ' + [ SELECT Body, Type FROM CollaborationGroupFeed ]);
    }

}

Output:


Cheers!!!

File Upload and Download Security in Salesforce

1. Go to File Upload and Download Security.


2. Click Edit and set it.


Cheers!!!

How to use GITHUB as version control in Salesforce?

1. Go to https://github.com/.

2. Create an account or use your existing account.

3. Create a new Repository.


4. Click "Create Repository" to create the repository.


5. Go to https://git-scm.com/downloads.

6. Download and install GIT.


7. Open Command Prompt and type git --version to confirm that it is installed properly.


8. Create a Force.com Project using Force.com IDE in Eclipse.

9. Go to Team --> Share Project.


10. Click Create.


11. Click "Finish".


12. Right Click the GIT Repository folder selected in 11th step and select GIT Bash Here.


13. Execute the below commands one by one. Do not just copy and paste.

git init
git add MySFDCDevOrg
git config user.email "your email id "
git config user.name "You Name"
git commit -m "first commit"
gt remote add origin https://github.com/magulan/MyDevOrg.git
git push -u origin master

14. Enter your github credentials when prompted.


15. Go to GITHUB and verify.


How to Commit Changes to Git from Force.com IDE in Salesforce?

http://www.infallibletechie.com/2017/03/how-to-commit-changes-to-git-from.html

How to view history in GITHUB?

http://www.infallibletechie.com/2017/03/how-to-view-history-in-github.html

Cheers!!!

How to find how many records an user created across all objects in Salesforce?

1. Go to that user record.

2. Click View in Data Usage.


3. Below will be the output.


Cheers!!!

How to view history in GITHUB?


Cheers!!!

How to Commit Changes to Git from Force.com IDE in Salesforce?

1. Right Click the component and select Team --> Commit.



2. Drag and Drop from Unstaged to Staged and click "Commit and Push" button.


Cheers!!!

Upsert requires view all data on a non-unique custom index

To fix Upsert requires view all data on a non-unique custom index, check the below

1. Make sure the External Id field column in the file or table is unique.

2. Make sure the user has access to the External Id field.

3. Make sure Unique check box on the field is enabled if the profile doesn't have View All Data permission enabled.

Cheers!!!

Pre-Org Migration Checklist for Salesforce

1. Add remote site settings.

2. Enable if any features have to be activated like Person Account, etc

3. Check for Named Credentials.

4. Check for Connected Apps.

5. Check for Organization Wide Email Addresses.

6. IP ranges for organization level.

7. IP ranges for profiles.

8. Login Hours.

9. Password Policies.

10. Session Settings.

Cheers!!!

Is there a way to report on who is using SF1 and the device they are using ?

1. Create a Custom Report Type.


2. Create a report with the custom report type created.


Cheers!!!

LockerService For Lightning Components

At a high level, LockerService uses various technologies and techniques that are intended to do the following:

Prevent:

Components from causing XSS and similar security issues
Components from reading other component’s rendered data without any restrictions
Components from calling undocumented/private APIs

Enable:

Cool new features like client-side API versioning similar to REST API versioning*
Faster security review
Better and more secure JS development practices
Running 3rd party JS frameworks like React, Angular and so on*
Easily adding or removing new security features and policies

Check the below link for more information

https://developer.salesforce.com/blogs/developer-relations/2016/04/introducing-lockerservice-lightning-components.html

Cheers!!!