Sunday, August 18, 2013

How to develop (utilizing the full power of  Java/Groovy) and deploy (into cloud) a Salesforce external extension and integration in 3 minutes 

(Part 2: consume the Integration Pack, from Account trigger.)


YouTube DEMO video:
http://youtu.be/KaubGkES6eY

Tech Notes
"CloudChoir - Integration Foundation" created a Customer Object called "Integration", it servers as "Outbound Message" hub, thus all your integrations will go through it. Thus you DO NOT need to create Outbound Message and related trigger workflow for each Standard Object and Customer Object individually, in order to get them integrated... our "Integration Foundation" did them all for your easy use.

In this DEMO, I will show you how easy it is, to develop a simple Account APEX trigger, to utilize our integration framework... it could be calling Customer Java code, or SSH call (JSch in our server), or even SOAP call (Axis2 in our server) or REST call (Restlet in our server),  all through Outbound Message, thus no worry about "Callout governor and limit".

Email: admin@konafornia.com
(I am currently looking for Salesforce dev job and/or sub contracts. thx!)

__________________________________________________
Reference: APEX trigger source code (used in above DEMO):
trigger AccountOutboundMessageTrigger on Account (after insert, after update) {
    if (Trigger.isInsert)
    {
        for (Account acct : Trigger.new)
        {
            String sInput = '<root><title>' + Trigger.new[0].Name + '</title><fullname>' + Trigger.new[0].Phone + '</fullname></root>';
            Trigger2Cloudchoir cc = new Trigger2Cloudchoir();
            String sChildRecordID = cc.CreateCloudChoir(acct.Name + '(temp)', 'account', 'Description', acct.Id, '-security-', 'HelloWorld', sInput);  
            break;
        }
    }
    else if (Trigger.isUpdate)
    {
        if (Trigger.new[0].Description != Trigger.old[0].Description)  //thus no infinite loop
        {
            String sCurrentRecordID = Trigger.new[0].Id;
            List<cloudchoir__Integration__c> l_child = [SELECT Id FROM cloudchoir__Integration__c WHERE cloudchoir__Callback_Record_ID__c =: sCurrentRecordID];
            if (null != l_child && l_child.size()>0)
            {
                delete l_child; //remove the 'temp' Integration record. (no need this delete, if you choose to keep it.)
            }
        }       
    }
}


No comments: