Our Salesforce Consulting Team steps through a simple MuleSoft Integration
At Girikon, a Salesforce Consulting Company we believe Salesforce is the world’s no. 1 cloud platform based on CRM (Customer Relationship Management) capabilities. Early last year Salesforce agreed to acquire MuleSoft for a mutli-million-dollar cash and stock deal. MuleSoft, a software company that provides integration software for connecting applications, data and devices.
Girikon’s Salesforce Consultants specialise in many Salesforce products and after the announcement our consulting team gained certifications in MuleSoft. Girikon is commitment to keeping ahead of the pack with knowledge and certifications for leading technologies.
In this blog we are focusing on Salesforce integration with MuleSoft.
Firstly, we will need a Salesforce developer account by clicking on the following link:
https://developer.salesforce.com/signup.
Then a MuleSoft account by clicking the following link:
https://anypoint.mulesoft.com/login/signup.
In this first example we can send a couple of contact records to Salesforce with the help of MuleSoft. For this we have to download any point studio which is a MuleSoft IDE by clicking on this link https://www.mulesoft.com/lp/dl/studio.
We are going to use any point studio for this data transfer. First download the any point studio. Then extract the zip file in your directory and the click on the application to install it. After installation is finished click on the any point studio icon it will launch a wizard like shown in the figure below.
Fig: – Launch Wizard of Any point Studio
Click on the launch button after selecting the directory of your workspace. It will then open the any point studio as shown in the figure below.
Fig: – Any point Studio
Open the example project in Any point Studio from Any point Exchange by logging into your MuleSoft account.
Download Import Contacts into Salesforce application. Note: do not run the application.
Login to your Salesforce account.
In the left navigation bar, open My Settings under the Personal Setup heading, click to expand the My Personal Information.
Click Reset My Security Token. Salesforce resets the token and emails.
Open your mail account where the security token is sent and copy the token onto your local clipboard.
Now open your Any point Studio after downloading and opening the application it will look like as shown in the given fig.
Fig: – Any point Studio with application
In your application in Studio, click the Global Elements tab. Double-click the Salesforce SFDC config global element to open its Global Element Properties panel.
In the Security Token field, paste the Salesforce token that you copied from your mail.
Alternatively, configure the global element in the XML Editor.
Change the contents of the Username and Password fields to your account-specific values, then click OK to save your changes.
This application project includes a sample CSV file, contacts.csv, that you can use to view the end-to-end functionality of this application. The CSV file will look like this.
Fig: – contacts.csv
In the Package Explorer, click the src/main/resources folder to expand it, then find the contacts.csv file inside this folder. Double-click the File config tab in the Global Elements tab and set the Working Directory field to point to the src/main/resources folder. In the Package Explorer, right-click the import-contacts-into-salesforce project, then select Run As > Mule Application.
Studio runs the application on the embedded server. After the application runs successfully it will create two contacts records in salesforce which the csv file contains. Open your salesforce account, then navigate to the Contacts tab. It will show you two new entries: John Doe and Jane Doe.
Fig: – Two new contacts created
About Girikon
Are you looking for a Salesforce Integration expert? At Girikon it is where the search ends. Girikon is a Salesforce Consulting Partner and has the required set of tools, skilled resources and technical knowledge to understand the platforms an organisation uses and transforms your existing systems to a truly interoperable solution.
Girikon’s Certified Salesforce Consultants understand the rapid increase of mobile, cloud and social platforms. They are here to assist customers who are left to their own devices to develop a solution for their organisation. Girikon Salesforce Consulting Services team made up of Architects, Developers, Business Analysts, QA experts have the required knowledge and are certified to design and delivery integrations to suit your needs.
Our Service team are cost-effective, and our Consultants will develop a strategy to bring together a quality solution which can be across multiple applications and technology platforms such as Salesforce, Microsoft, Oracle, Abode, SAP etc.
Salesforce is one if the leading CRM platforms used across the globe. According to Girikon’s Salesforce Consultants it is one of the largest and widely used CRM software in the market. Salesforce has two types of storage i.e. Data storage and File storage. File storage includes attachments, items a user has uploaded into the Documents tab, and Salesforce CRM Content. Contact Manager, Group, Professional, Enterprise, Performance, and Unlimited Editions are allocated 10 GB of file storage per org. Essentials edition is allocated 1 GB of file storage per org. All other data, including activities is considered a record and counts towards your Data Storage allocation. Data Storage limits for every Contact Manager, Group, Enterprise, Professional and as well Performance editions are calculated at either 1 GB or on a per user limit (20 MB per user) whichever is required for production orgs. For a business keeping their expenses in check keeping an eye on storage limits is the main goal.
We all agree that Salesforce is a great CRM but when it comes to licence pricing it can get very expensive when you consider licence per users etc. If the organisation’s concern is storage cost and the users are continually uploading data at an alarming rate, then it is important to apply Girikon’s strategy for managing the orgs data. Emails and Cases are very crucial pieces of information and they can take up a lot of space. Each email takes around 2Kb – 10Kb data (it varies on a case by case basis depending on the email content) and each attachment sent alongside the email can be up to 20Mb. Management of the orgs data can be more effective by managing by archiving and then restoring the emails when needed.
The Archiving strategy is very simple, and it has proved to be very effective. Our Salesforce Consultancy Services team often advise users to use the two custom buttons which are Archive and Retrieve which does all the work for the users. When clicking on archive, the emails in the related list gets archived or gets stored as an attachment.
Before sending or receiving the email.
After sending the email. The email is showed in the email related list and the data storage is increased.
When the archive button is clicked.
A visual force page pops up to ask you that “Are you sure you want to archive?”
After archive the email gets into the attachments and the data storage is decreased.
Let us explore the backend logic behind the storage when an email is sent or received, it creates a record in emailMessage object and the attachments along with that email creates a record in attachment object in salesforce. The record that is created has a parent Id equals to the case Id and the attachments that were sent along with that email have their parent Id equal to the email record Id. So, when we hit on archive button the code runs in the background which creates a new record or file i.e. email(emailId).txt in the attachment object which have the email and its details such as: – BccAddress, CcAddress, TextBody/HTML body etc. And for the attachments that were delivery with the email, the parent Id of those gets re-parented and now is equal to the caseId. After that the email record in the emailMessage Object gets deleted which reduces the Data Storage.
Email retrieving is also necessary after the user has archived as per the step above to be viewed at a future date. There is also an opportunity for the user to delete the emails.
Click on retrieve button.
A visual force page pops up and asks, “are you sure you want to retrieve?”
The email is retrieved. And the data storage is increased.
Let us explore the backend logic behind the storage when an email is retrieved. Code is written in such a way that it reads body of email(emailId).txt and then creates a new record in the emailMessage object from it. For the email attachments, they are again re-parented back to the email with the help of a custom field which the system created in the emailMessage Object to retrieve the attachments. The custom field contains the old Id of the email when it was not archived. After all this is done the code deletes the email(emailId).txt file from the attachments.
About Girikon
Girikon is a Salesforce Consulting, Oracle Gold, Microsoft Application, Adobe Bronze Technology Partners. We are also ISO 9001 Quality Management and ISO 27001 Data Management system certified. Girikon’s Headquarters are in the US, with offices in AUS and Technology centre in Noida India with over 150 employees across the three offices. Girikon is a Salesforce Consulting Company that provides cost effective services through a hybrid offshore/onshore model, quality delivery and great testimonials.
Json parsing using Workbench
-
April 30, 2019
-
Sourabh Goyal
Parsing JSON data from Workbench
Why do we always start a question with“why”? The first question that comes to our mind is “Why we are using Workbench for JSON parsing?”
As a Salesforce Consultant I would also follow up similarly with a few other questions such as “Is it the simplest method of Parsing JSON data?”, and “are there other ways in which we can parse JSON data in workbench”. Over the last 4 years with Girikon in the Salesforce Consulting Services team I will try and answer the questions above through an understanding of the given methods below:
METHOD 1: JSON PARSING THROUGH WORKBENCH VIA SERVER
The JSON file is developed as separate code and therefore the most efficient way to check the dynamic project is through the Workbench JSON data parsing method which will benefit the developer by bypassing the rest of the code meaning there is no chance of changing existing code and messing it up. Using Workbench JSON data parsing method also provides the additional benefits such as time saving which translates to increased efficiencies, less complexity and reduced vulnerability to the written code.
Follow the below steps for using Rest Method through workbench:
1. Before you start it is important to set up an account in Workbench.
https://workbench.developerforce.com/login.php?startUrl=%2Fquery.php.At this point login with your Salesforce account.
2. Go to Utilities -> and select Rest Explorer
3. Select the Http Method as POST.
4. Create an Apex class, for mapping the data to be Posted.
5. Set the URL according to Mapping URL and Method
6. Provide the JSON Data in Request body.
And, check the content type from headers.
OUTPUT from the Rest Method will be as follows:
and a new account record will be created in Account sObject .
METHOD 2: JSON DATA PARSING THROUGH WORKBENCH TO SOBJECTS
1. Go to workbench -> Rest Explorer -> HTTP Method POST
2. Now, set the path of the sObject you want as we have used sObject Account to Parse the JSON data.
3. Provide the JSON Data in Request body.
For example:
This will create an account sObject in your Org.
OUTPUT:
and a new account record will be created in Account sObject.
About Girikon
Girikon is a Salesforce consulting company,based out of Phoenix, Arizona with development centre in Noida, India and offices in Melbourne, Australia. Girikon’s global network of offices in USA, India and Australia, allows Girikon to quickly respond to customer’s requirements with a view to effectively delivering a quality product and service. Girikon has a team of experienced and certified Salesforce Consultants including Architects, Developers, Consultants, and Administrators.
Girikon’s team of dynamic, seasoned and qualified professionals have a vast experience in IT across various business areas, Software/ Product development, design, testing, maintenance and resourcing / staffing options. We believe in developing scalable & simplified solution for our clients.