Thursday, December 29, 2016

Salesforce Metadata Extract to CSV/XLS and Analysis - How tos

Salesforce Metadata Extract to CSV/XLS and Analysis - How tos

There are different ways you can extract Salesforce metadata and analyze the information. Following are some of the ways you can extract the Salesforce Metadata and analyze it.

Use cases where you will need to analyze Salesforce metadata:
  • For change management of your existing Salesforce org customizations
  • Evaluating the impact of a change Vs current state of salesforce metadata.
  • While merging two salesforce org or migrating from one salesforce org to another salesforce org.
  • Integrating with another salesforce org
  • Salesforce org health check-up
  • Re-engineering the Salesforce Org etc

Following are few of the ways you can extract the Salesforce metadata  for analysis:
  • Using eclipse extract metadata in XML format and convert XML to CSV
  • Sublime plugin-Haoide
Extract Salesforce metadata: using eclipse and XML to CSV converter:
  •  If you are wondering how I can read the salesforce metadata in an excel spreadsheet then here are the steps you can follow: 
    • 1) Get the Metadata file using Eclipse (using force.com plugin) 
    • 2) Use the website "http://www.luxonsoftware.com/converter/xmltoexcel" to convert "XML file" to "Excel Spreadsheet" (for Free) or any other tool that converts Nested XML to Excel http://xmlgrid.net/xml2text.html 
    • 3) How you can do that using the web-site "http://www.luxonsoftware.com/converter/xmltoexcel": 
      • a) Upload the XML file in the above website and click the convert button 
      • b) Download the result and it downloads in excel format with sub-tabs for each nested loops Example: If you wanted to view fields in page-layout. 
      • 1) Get the page-layout XML file using Eclipse (using force.com plugin) 
      • 2) Upload the page-layout(In XML format) to the web-site (http://www.luxonsoftware.com/converter/xmltoexcel) and convert to "Excel Spreadsheet"
                  OR 
    • 4) How you can do that using the web-site "http://xmlgrid.net/xml2text.html": 
      • a) Upload the xml file in Source Data section. 
      • b) After loading the source data "Convert" button will appear. Click on "Convert Button". (Select a given node before clicking on convert button) 
      • c) The output will be displayed in output section. You can expand the nested nodes and copy manually the entire section and paste it to a excel spreadsheet. or click "Save" button to save it in CSV format.
 Extract Salesforce metadata using - sublime plugin HAOIDE

  1. Download and Install Sublime Text 3
  2. Install Package Control
    • Package Control is used to easily create and setup packages in Sublime, in other words, it makes it so you can easily install apps v. having to enter code in the console every time.
  3. From the Package Control Install page, copy the text in the Sublime Text 3 box.
  4. In Sublime, go to View – Show Console
  5. Paste the text copied from the Package Control site into the Console and press enter.
  6. After Package Control is installed, a message box will popup, press ok.

Install the Haoide Package

  1. Re-open Sublime and go to Tools – Command Palette…
  2. Select ‘Package Control: Install Package’, you can do so by starting to type install in the Command Palette.Install Haoide
  3. A list of packages to install will appear in the Command Palette, type ‘Haoide’ and select it.
  4. Exit Sublime and re-open.
  5. 012016_2346_8.png
  6. Before you can create a project, you need to setup your workspace. Navigate to: Haoide | Settings | Settings – User
  7. Enter the following test, with your information replacing the pink & save.  You can find a copy of my Default Settings and User Settings here.
    "workspace" : "C:/WHERE/YOU/WANT/TO/SAVE",
    "projects" : { "YOUR_PROJECT_NAME_PROD":
         {
              "allowed_packages":
                     [
                     ],
              "default": false,
              "login_url": "https://login.salesforce.com",
              "password": "YOUR PASSWORD HERE",
              "security_token": "YOUR SECURITY TOKEN HERE",
              "subscribed_metadata_objects":
                   [
                   ],
              "username": "YOUR USERNAME HERE"
         }
    }
    
    
  8. Retrieve SObject and workflows usign HAOIDE.
    
    
     
  9. Click on export to export any of the following metadata to CSV.



Sunday, November 27, 2016

Steps to Build a Chrome Plugin


Happy Building Chrome Extensions!


STEP-1: Create a folder "TrialChromePlugin"

STEP-2: The following files are needed to build a chrome plugin:
  • manifest.json
  • html page (if has a UI and a pop-up extension)
  • icon png/image file

STEP-3: If chrome plugin needs "javascript libraries"
  • Create a "js folder" inside the "TrialChromePlugin" folder
  • Store the javascript library files in the respective folder

STEP-4: Build the html page and the necessary javascript and store in the respective folders mentioned in Step-2 and Step-3.


STEP-5: Load Chrome extension in local browser
  • By selecting the above folder in: chrome://extensions->Load unpacked extension

STEP-6: Login to "https://chrome.google.com/webstore/developer/dashboard" pay a onetime fee of 5$. The developer dashboard helps to track the chrome plugin usage and # of downloads. You can also intergrate the plugin with Google Analytics.


STEP-7: Prepare the zip file by including key.pem file
  • Click on "Pack Extension" button on "Chrome://extensions" to generate key.pem file
  • Include key.pem file in the folder "TrialChromePlugin"
  • Then create a zip file of the "TrialChromePlugin folder". Learn more by visiting the site: https://developer.chrome.com/extensions/packaging

STEP-8: After you publish the plugin in chrome webstore if you need to update the chrome plugin what you need to?
  • Click on "Add New Item" on "https://chrome.google.com/webstore/developer/dashboard"
  • Follow the steps: 1) Upload an extension or app (.zip file) 2) Click on "Upload" button 3) Follow through the guided steps






  

Sunday, September 25, 2016

Data Driven Integration Framework


Data Driven Integration Framework: Scalable, Re-usable approach for systems Integration

Scenario: On Premise Application Integration with Salesforce.com

Why?

  • Eliminate code redundancy for multiple integration syncs between systems
  • Leverage for future integration between systems
  • De-coupling the change management between systems
  • Productivity


What?
  • A Script Interpreter Framework which is used to read the integration script definitions (curl calls) stored in a data store for performing the integration calls using the real time data
How?
Use Case/Example:
Automation of syncing contact information from an “On Premise Application” to “Salesforce CRM” for a given account without leveraging any salesforce connectors/tools for Salesforce.

Flow:
When the contact sync event is triggered from the “On Premise Application” the following steps needed to be performed:
1> Find the “Account Record Id in Salesforce CRM” with the “Account Name” field in the “On Premise Application”. If not found create it.
2> Find the “Contact Record Id in Salesforce CRM” with the “Contact Email Address” field in the “On Premise Application”. If not found create it.
3> Find if the record exists in “Account Contact Role object” in Salesforce CRM. If does not exist then insert.
4> Repeat the steps (2 and 3) for “multiple contacts” sync for the given account.

What is the one of the simplest solutions can be using “Standard Salesforce Rest API”?:
1> Write 6 curl statements by sending the necessary data from the On Premise Applications.
2> Use a loop in case of multiple contacts.

Challenges with the above solution:
1> The code is not re-usable/scalable as code needs to be changed whenever field API name changes, new object integrations etc.

How “Data Driven Integration framework” can solve some of the above changes?
1> Create a XML based configuration or a data store with the following attributes:
  1. Event name
  2. Step Sequence #
  3. Step Name
  4. Dynamic Script
  5. Alternate Script
  6. Operation Type (Get/Set/Insert/Upsert/Delete)
  7. Transaction Type (single/multiple)
2> Develop a “Script Interpreter” that Reads the configuration, interprets and executes the integration calls.
In the above example the configuration will look as follows: