Do it with SOQL

Deleting User Trace Logs

If you go to User Debug Log, you may see many user trace logs created by a user. Deleting one at a time is time-consuming. An easy solution is to execute below SOQL in Developer console and deleting them ( you can select multiple rows and can delete in one shot )

Mass Delete Attachments

Though Data loader is one option to do it, you can also use Developer console Query editor to mass delete attachments ( execute the query with appropriate constraints and select the rows you want to delete and hit delete button )


Bulk Delete ApexLogs

Its very painful to use Salesforce provided ‘Delete All’ logs button as it on;t deletes log files displayed in that page. Quick way of deleting log files using SOQL is executing below SOQL in developer console and use ‘Delete’ button


Salesforce Certified Identity and Access Management – Spring ’18 Release Exam

An administrator resets a user password in Salesforce.

Which attribute will be updated with the “True” value in the Identity URL or UserInfo endpoint?

A. email_verified
B. password_updated
C. password_reset
D. active


Universal Containers (UC) uses Salesforce for all of its internal users. Recently UC started getting a lot of complaints from users regarding locked user accounts due to users not being able to reset their passwords.

What is the recommended solution a Salesforce adminisrator can follow to solve this problem?

A. Implement a third-party Identity Provider to centralize user management and authentication policies.
B. Modify password policies and set Password Expires to “Never Expires” so that users can log in without any interruption.
C. Configure social media authentication provider to allow users to log in via their social media credentials.
D. Enable two-factor authentication using Lightning Login to allow users to log in without their passwords.


Universal Containers uses Customer Community for its customers and wants to make sure that there is an extra layer of security to avoid unauthorized access.

What is the recommended way of enabling two-factor authentication for external users?

A. Update external user profile to allow users to verify their identity and avoid unauthorized access.
B. Use an AppExchange application to implement two-factor authentication for external users.
C. Use dynamic login on the customer community to allow customers to verify their identity.
D. Use custom login flows to implement two-factor authentication for external users.


Universal Containers (UC) uses an external website to allow its customers to perform self-service functions. The website doesn’t support autentication through SAML or OpenID Connect. UC has decided to impement Salesforce and authenticate its users via Salesforce.

What is the recommended solution to allow users to authenticate via Salesforce on the external website?

A. Configure a connected app in Salesforce and use username-password flow to allow customer to authenticate on the website.
B. Configure Salesforce as a Service Provider, and implement custom federation services using existing Identity Store.
C. Configure Customer Community identity providers, and use Embedded Login to allow customers to authenticate on the website using configured identity providers.
D. Migrate the website to Customer Community to allow a seamless experience and set existing passwords as their customer community user passwords.



Universal Containers (UC) uses Customer Community to allow its customers to register and perform self-service functions. Due to the growth of the business and the customer base, UC wants to deliver a different experience to its customers based on runtime circumstances.

What is the secure and recommended way of enabling this?

A. Develop Lightning components to deliver different experience to customers using their information stored in Salesforce.
B. Use custom login flows to deliver different experiences by extracting the source from the URL where the customer is visiting from.
C. Use an AppExchange product to customize the Customer Community login experience and deliver a personalized experience to customers
D. Enable dynamic login experience by adding expid request parameter in the client configuraiton SSO initialization URL.



How to create and insert data into Big Objects


Use Case:

Company A stores credit card transaction data in Salesforce. Data is stored as Person Accounts all the transaction data is stored in the person account.  Number of transactions can grow to more than 10 million to 100 million depends upon the member base of the Company A


Say for instance we are interested in

  1. Capturing transaction data under person account
  2. Processing transaction data for further processing ( like the redemption of the user acquired commissions )
  3. Letting Customer support team filter the transaction data
  4. Running reports on transaction data


Why can’t we use Salesforce provided Big Objects to attain above functionality.  Wait.. before we design the solution let’s understand the Big Object limitations

  1. You can’t create Big Objects using Salesforce Setup, instead use Salesforce Metadata API to create these objects
  2. No triggers can be implemented on Big Objects
  3. No Page Layouts
  4. Querying data using SOQL is comes with limitation, you can query data on Index fields
  5. You can’t design Workflows, Process Builders etc
  6. You can’t run reports on the Transaction data

Instead of looking into the negativities of the Big Objects I looked into the beauty that can bring with these limitations. I trust Salesforce Architect team designed few of these limitations on purpose due to its multi-tenant architecture. Designing triggers, querying data on non-index fields, running reports , designing workflows, process builders all have a risk when not properly handled by an architect/developer when doing things.


Creating Big Object 

Field NameTypeLengthIndex
Transaction DateDateIndex
Transaction AmountNumber5,2
Merchant NameText 50Index
Transaction LocationText25

Big Object can’t be created from Salesforce setup. In order to create Big Object you have to use Salesforce Metadata API.  Let’s create a package and deploy to Salesforce using workbench.

Create file : Customer_Transaction__B.object


Step #2 : Create Permission set



Step #3 : Create Package.xml file


Step #4 : Create zip file for deployment

Customer_Transaction__B.object,  package.xml, Customer_Transaction.permissionset

Download zip file customer_transaction


Step #5: use workbench to deploy the code

Upload zip file and click Next , follow the instruction to deploy the code

Step #6 : Use Bulk Api Java Code for data Migration into Big Object



Heroku postgres Integration with

Login to

Go to heroku Dashboard

Click ‘New’ to create Application

Create App

Enter App name: sfdc-heroku-integration

click ‘Create app’ button to continue


Click on App icon and select Elements

Select Heroku Postgres on the Heroku Elements page



Click on ‘Install Heroku Postgres’ and continue



Select your app name to install Postgres



select the free version and click on Provision button



You will landup on the below page after successfully installing Postgres on the Heroku platform



Installing Heroku Connect

Heroku connect  helps you to synchronize data to Salesforce



Select app name to install Heroku Connect, in our case app name is sfdc-heroku-integration



Click on Provision button to continue


After successful installation, you will be landed on to the below page


Configuring Heroku Connect to Sync data from Salesforce


Click on Heroku Connect from Dashboard->App->Resources section


Click ‘Setup Connection’


Enter schema name and click Next


Click ‘Authorize’ and continue


Select your Salesforce org to install, After successful installatoin, you will see below screen



Synchronize Salesforce object data into Heroku Postgres


Click ‘Create Mapping’


select Objects you want to synchronize


Select Object Fields you want to Synchronize, you can also set Poll Frequency ( minimum poll frequency set at 10 minutes )




After you complete the setup you will see below screen. We can clearly see number of fields, number of records that are inserted into Postgres DB

Salesforce to Salesforce Integration using REST Webservice

Use Case:

An organization has two salesforce org ( Sales Org and R&D Org ). Sales Org user wants to create a support request in R&D org for a Sales Org opportunity. R&D org team has special skills to work on those Support Requests. Sales Org user is willing to share some of the opportunity field data and restrict sharing access to only for the opportunities that have Support Requests. Sales Org User is also interested to know the status and owner of the Support Request. R&D Org users should be able to run reports on Case/Support Request/Opportunity(Sales Org) data


Providing a button on Opportunity UI to create a support request. Invoking a Visualforce page and using a controller class system can call Webservice on R&D Org to create a Case. Whenever a Support Request is created checkbox is updated in opportunity object, based on the checkbox opportunity information is shared with an integration user. Salesforce lightning connect is used to integrate Sales Org & R-&-D org. Check out my blog post on lightning connect. R&D Org can call webservice on Sales Org to update Support Request Owner and Status details in Sales Org system.



Below flow gives a top view of how the integration/data flow between the systems.


Step #1: Authentication

Sales Org calls Webservice on R&D Org

R&D Org authenticates Sales Org call

R&D lets Sales Org create Case after authentication

Salesforce configuration details:

Configure Connected App in R&D Org

Configure Authentical Provider in Sales Org

Configure Named Credentials in Sales Org

Use Named Credentials in Webservice Callout script

Follow blog post ‘How to configure Named Credentials


Step #2: Creating Webservice on R&D Org



Step #3: Controller class to create call R&D Webservice from Sales Org



Step #4: VF Page to create Support Request



Step #5 : Create Support Request button configuration on Opportunity Page

go to Setup->Opportunity->Buttons to create Button



Step : #6: Add button to Layout






Sample @future code – ready to process when resources are available


When to use?
Long-running processes or external calls
When it’s not batchable

Asynchronous process without concurrent limit
Easier and quicker to implement as opposed to batch

Parameters passed in can be only of primitive types
Can’t chain @future methods
Difficult to access job id

Batchable code to update Contact address with Account Address

Simple code to write Batchable code in Apex




A simple Webservice callout script