Posts

Showing posts from 2015

Test apex rest class Callouts using StaticResourceCalloutMock

Everybody googles about covering the rest callouts and ends up using almost one solution, i.e., creating a Mockup service class and use it in the test class. But there is an easy way and its been out there for quite sometime. It is really so simple that you can end up writing the test class in less than a minute, you need to have the response JSON of the callout that you are making in your actual class. You will have to catch that from either  system.debug(res.getBody()) or get it from the other system. That would look something like this: {"status":"OK","message":"Search request completed successfully","result":{"appId":110,"requestId":225877959,"resultCount":9,"pageInfo":{"pageSize":10,"requestedPage":2,"totalPages":2,"totalResults":19},"nextPage":false,"sourceItemIds":"1101-1110-1111"}} 1. Catch that response in a text

Passing URL parameters to controller in Lightning components/ AURA

Image
The following example helps you understand how to pass parameters from URL to components. In AURA/ Salesforce1 platform, it is made easy to pass the parameters to the controllers. We know that we can create attributes in the components as variables and they are meant for the scope of the components. So we create application attributes for the entire scope of application. So when we need to get the values from the URL, it is easy to pass them to application attributes, in other words, application attributes can take the values from URL directly. Here is a simple example: 1. Create an application - 'URLApp' 2. Create an attribute in the application XML. <aura:application> <aura:attribute name="fromURL" type="String" default="this is default value"/> Value in Attribute: {!v.fromURL}! </aura:application> Save the XML and run it, your output should be: Now, If you just pass a value to the url the

Set up Salesforce IQ for GMAIL (chrome extension)

Image
In Dreamforce'15 there were so many interesting things. I was just going over the highlights of the the mega event found here  and super-parker's talk with Marc, here . I am going to show you how to set up the IQ add-on that they announced. It helps sync up your mails with CRM. But doing it with chrome has a benefit. Please find the extension here and click on "ADD TO CHROME": https://chrome.google.com/webstore/detail/salesforceiq/cnkgdfnjmgamkcpjdljdncfjcegpgcdg?hl=en-US After adding it to chrome, open your Gmail, you will find something like this: Click on "Connect with Salesforce" and log on to your salesforce org. Thats all, your gmail is not connected with salesforce. See how we can create opportunities along with new contacts under old/ new account. Once you are logged in, you will something like this: Switch the tabs to the   icon, click on Create button and select opportunity, you will now see: This lets you

Lightning Components Basics, Creating A Dynamic Picklist.

Image
Folks,  In my previous  post , I talked about the way I look at the Salesforce1 as a platform. Today I will explain how I understand these components. For a guy with an average IQ and little experience on Visualforce/ Apex, like I am,  it is easy if we correlate lightning components with visualforce Before we start, I recommend doing this exercise, Please this:  https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/qs_aotp_app_customobj.htm and also from Step 1 through Step 6. If you understand that completely, you dont have to go through the following reading. But If you dont understand it, I take it as you are not very much familiar with Bootstrap, angularJS and importantly, Callback functions. The book says " The Framework uses an event-driven architecture for better decoupling between components. " If you know javascript, you know events and event-handling. But when I looked at the javascript they used in the ltng componen

Lightning Components , The Way I look At It.

We have been noticing the talks about lightning, salesforce1 platform, a brand new platform by salesforce. Lightning is an Aura based technology, a component framework. To understand it better we need to look back and see the way that salesforce did things back in 2006-08, that when salesforce introduced force.com platform. I come from Siebel CRM, another ERP, I see most of the core CRM capabilities common in both CRM systems. And we have also seen many Siebel CRM customers moved to salesforce for it's Rich Internet Application features and browser compatibility. And not to mention the role of Visualforce page in that. So, what Siebel could not do and salesforce could do is, being able to create WEB applications using Visualforce technology. We know that this is another force.com platform capability which is built using JSF. Visualforce has its own tag library, when the developers write a simple tag like <apex:commandButton action="{!doMe}"..../>, its compiles

Process Builder Update Child Records

Image
Hi, Process builder has excellent capabilities that can replace half of your salesforce Org triggers. For the starters, Process builder is another automation tool that saleforce has its bag. Workflow is the automation tool that was built on force.com platform, where as PB is built on salefsorce1 lightning platform or AURA. There are lots of interesting capabilties like, calling apex classes, invoking automated flows, making chatter posts and updating related records etc... In the following video, I talked about a scenario that definitely needs a trigger before the PB. To do this example, I created a contact lookup, two formula fields to get the contact's email and phone on Account and also a checkbox on Contact. HTH, Prabhan

401 Certified Again... :)

It's been awhile since wrote on my blog, I have cleared 401 again.. I meant my last one got expired as I was busy with other stuff. I want to continue this and take it next level like 501... I have been notified by salesforce that there are going to be few new certifications. I hope to have one more entry here: http://certification.salesforce.com/verification?&fullname=prabhanjan%20nandyala :D Prabhan