Friday 15 November 2019

Salesforce Virtual Dreamin

Virtual Dreamin

We are glad to announce the world first Salesforce Virtual Dreamin after a great success of Apex Hours, Automation Champion and Path To Code virtual program. All these events got fantastic response from various part of globe because it can be attended by anyone from anywhere.

This Idea and huge response from audience, on how convenient it is to join conference or remote meetings inspired the idea of First Salesforce Virtual Dreamin.

"Geographical location is not an obstacle anymore. Join Dreamin from anywhere on planet"

Virtual Dreamin would be running for 24 hours for 2 days, so that everyone would get chance to join sessions in their timezone. Save the date MAY 16-17 2020 and follow us on Virtual Dreamin Website for more detail.

Virtual Dreamin is focused for all audiences who wants to start or advance their career in Salesforce. All the session will focus on all below track
  1. System Admin
  2. Salesforce Developer
  3. Architect

FAQ
  1. What is Virtual Dreamin ?
    This is a community driven event for community. Where we will joins lots of Virtual Salesforce sessions.
  2. Who Can Attend?
    Any one who want to become Salesforce Admin, Salesforce Developer or Salesforce Architect.
  3. Why Should I Attend ?
    You get to witness inspiring keynotes and sessions by some of the best from Salesforce.
  4. How to register ?
  5. What is the registration fee ?
    Free, Yes this is free event which you can join from your home or office. You only need one good Internet Speed.

Follow us
  1. Facebook
  2. Twitter

Please share your feedback and let us know what you want to learn in Virtual Dreamin


Thanks,
Amit Chaudhary
Founder of ApexHours and Virtual Dreamin.
Salesforce MVP

Friday 8 November 2019

Import and Export Data using SalesforceDX (SFDX)

Import and Export Data using SalesforceDX (SFDX)


In this post we will talk about Data migration using SalesforceDX. We have a vary simple use case to Import and Export data from one Salesforce Org to another Salesforce Org. We know we can do the same with dataloader or some other custom tool. But in this post we will talk about how to import and export with SalesforceDX (SFDX). If you are new to SalesforceDx please check this ApexHours Session Recording by Jitender Zaa.


How to export records with SFDX


 Step 1) First Login to your Salesforce Org from where you want to export data

sfdx force:auth:web:login --setalias myDev1

Step 2) Use below command to export the data

To Export the data we need to use "sfdx force:data:tree:export" command and we need to pass one Soql query. You can also pass the path of SOQL query file with the help of -q. Lets export the Account and its all related contacts records.

sfdx force:data:tree:export -q "SELECT Id,Name,(Select FirstName,LastName from Contacts) FROM Account limit 2" -d ./data -p -u myDev1

Here
-q : SOQL query or file path of soql query.
-d : directory, where exported json file can be saved
-u : Salesforce user to perform operation
-p : generate multiple sobject tree files and a plan definition file for aggregated import


Once you execute above command it will create three file for you in Data Folder.
  • Accounts.json
  • Contacts.json
  • Account-Contact-plan.json

How to Import data using Salesforce DX


First login to salesforce org in which you want to import the data. Then use below command to Import records in Salesforce instance, which we just exported in previous step

sfdx force:data:tree:import -p data/Account-Contact-plan.json -u myDev1

Where
-f : JSON file to be imported
-p : plan file
-u : Salesforce user to perform operation

The query for export can return a maximum of 2,000 records. For more information, see the REST API Developer Guide:
 

NOTE: For above use case you don't need any scratch org. You can simply login in any sandbox and migrate your data between two org's.


There is another Use case where we can use SalesforceDx for Import and Export Data.

Use Case: If you are implementing Continuous Integration (CI/CD) solution built for Salesforce, Some time you need to upload sample data into Salesforce.

Solution: For that you need to use command line dataloader or custom tool built to import export data automatically. We can use SalesforceDX for data import and export as well for this requirement.


Related Post :



Further Reading:

Thanks,
Amit Chaudhary