Feb 25, 2015

Salesforce Mobile SDK 3.1




Software Development Kit is typically a set of software development tools that allows the creation of applications for a certain software package, software framework, hardware platform, computer system, video game console, operating system, or similar development platform.


Salesforce recently launched Mobile SDK 3.1 which includes some upgrades and enhancements by which you can enhance your native and hybrid mobile applications. It's an open source pack of technologies like REST API and OAuth 2.0. As mentioned earlier it supports native and hybrid app development.


Here is the link where you will find most helpful resources to get started.


In a nutshell


-> CocoaPods for iOSYou can now use CocoaPods to merge Mobile SDK modules into your apps. No more tedious downloading, copying, and re-configuring. CocoaPods does it all for you.


-> Gradle for Native Android Apps : Android Studio and the Gradle build system are now fully supported for native apps.  Gradle support for hybrid apps will arrive after the next Cordova update.


-> iOS 7 is now the minimum OS version of iOS supported.


-> Raised the minimum Android OS version required by Mobile SDK to v4.2.2 (API 17).


->Supporting libraries upgraded to the latest versions


-> Flows to initiate authentication with an enterprise certificate


-> Unified SmartSync APIs (full offline support for application)



In case of queries and questions, feel free to reach out on discussion boards or StackExchange.

Cheers!!

Feb 23, 2015

MailChimp Authentication In Salesforce - Easy Steps (Authentication Part 3)

I hope following post might have helped you in authentication:


So here is the third part of the series, authentication with MailChimp

The whole process of authentication with Mailchimp is divided into some simple steps :

Step 1:- First of all to authenticate with Mailchimp, you must have an account on Mailchimp if not then sign up here.

Step 2:- Now create an app by selecting your name under the logo and select account.


Step 3:- Here as you can see in the given image below, select registered app and register an app here.


Step 4:- Once you've entered the details for your Company and Application and saved them, your client_id and client_secret will be displayed at the bottom of the "edit" page for your application.

Note: - Keep in mind that Redirect Uri is the Uriof your page where you want to be redirected with the "code" parameter.

Step 5:- Now create an apex class and paste the below code in it.


publicwithsharingclassMailChimpIntegrationController
{
 public string client_id = 'Your ClientId';
 public string client_secret = 'Your ClientSecret';
 public string authorize_uri = 'https://login.mailchimp.com/oauth2/authorize';
 public string redirect_uri = 'https://c.na15.visual.force.com/apex/MailChimpIntegrationPage';
 
 publicMailChimpIntegrationController()
 {}
 
 publicPagereferenceauthorizeMailChimp()
 {
  authorize_uri = authorize_uri + '?response_type=code&client_id=' + client_id + '&redirect_uri=' + Encodingutil.urlEncode(redirect_uri , 'UTF-8');
PageReferencepg = newPageReference(authorize_uri) ;  
returnpg ;
 }
 
 publicvoidmailChimpAccessToken()
 {
  string code = ApexPages.currentPage().getParameters().get('code') ;  
  HttpRequestreq = newHttpRequest();  
req.setMethod('POST');  
req.setEndpoint('https://login.mailchimp.com/oauth2/token'); 
req.setHeader('content-type', 'application/x-www-form-urlencoded'); 
req.setHeader('Accept', 'application/json'); 
        String messageBody = 'grant_type=authorization_code&client_id=' + client_id + '&client_secret=' + client_secret + '&code=' + code + '&redirect_uri=' + Encodingutil.urlEncode(redirect_uri , 'UTF-8');
req.setHeader('Content-length', String.valueOf(messageBody.length()));  
req.setBody(messageBody);  
req.setTimeout(60*1000);  

        Http h = newHttp();  
        String resp;  
HttpResponse res = h.send(req);  
resp = res.getBody(); 

system.debug('+++++----json---with---Access-----token----++++++'+resp);
 }
}


Step 6:- Now create a visualforce page and paste the below code in it.



 
   
   
 


Step 7:- At last create a new remote site setting with value as below

-> Remote Site Name : MailChimp
-> Remote Site URL : https://login.mailchimp.com
-> Active : True


I hope now you can manipulate the code according to the need. As these simple buttons on VFP shows you how to authenticate and get the access tokens.

Cheers!

Feb 6, 2015

Trailhead!! Developer Training Modules

Fantastic tool to make anyone comfortable with Salesforce. Are you new to Salesforce or searching for any topic in detail. Here you go.

Here you will find info specific to each topic and in detail. I would recommend all to go though this specially those who are thinking to give certification exams.

The only problem while registering is I was not able to associate my DE with trailhead because I've registered a namespace. So I created a new profile and completed some of the courses.

So steps are pretty simple

1) Go to this link

2) Select the module which you want to start with and then start your challenge.




Every time you complete a challenge you get points against it which is awesome. To get the points either you've to answer some questions which are related to the specific topic or you need to follow some instructions in your organisation.

Like recently two new modules have been added


Here explained all aspects of securing your data, like privacy of one's data from another. Or if records are visible to others they can't be edited. Or if can be edited then only few specific fields.

This excersise is super helpful for all those who are struggling with the sharing rules, permission sets etc..


Must read module specially for developers. This will help you better understand what you should follow while developing a functionality like first develop in sandbox, then deploy it to UAT/Testing org to make sure everything is working fine as generally UAT is full copy sandbox and exact replica of production. And then deploy it to production, this way you can ensure that your functionality is bulletproof and your production is safe to run on it.

These are just sample explanations, don't miss looking in all modules and many more are being added.

Cheers

Feb 5, 2015

Image to PDF Converter in Salesforce

Okay, so this is one of my POCs I was doing recently where I need to convert an image to PDF. I can't disclose the full use case but hope it will help some.

So here is the solution in two simple steps :

1) First insert these three static resources (with the same names)

(i) Bootbox




2) Visualforce Page

 
    
    
    
    
    
    
    
    
    
    
      
 
     
        
        
    
    
    
    
 

    

 

(As it was just a POC so code is not clean yet, hope you can take care of that)

Okay so now all set to go, just hit the page and select any image you want to get converted in PDF. Multiple images can also be uploaded.

Cheers