Salesforce Console Integration Toolkit
Salesforce provides a toolkit for processing huge data in Service Cloud Console. The toolkit is a browser based Java Script API and uses browsers as clients to display pages as tabs in the Console. It helps developers to implement custom functionality for the Salesforce console. For example, by using the Console Integration Toolkit, we can display Visualforce pages or third-party contents in the Salesforce console.
In this article, I have explained the steps I used to pass huge data (i.e. response from the external system) from one Console tab to another.
1. Create a Remote Site settings
URL ( https://raw.githubusercontent.com ).
2. Create a Wrapper class (ConsoleWrapper)
public class ConsoleWrapper { public String studentName{get;set;} public String isRegular{get;set;} public String status{get;set;} public String cleared{get;set;} public String clearedCurrent{get;set;} public String backLogs{get;set;} public String role{get;set;} public String studentNumber{get;set;} public String city{get;set;} public String prefferedLanguage{get;set;} public String university{get;set;} public String state{get;set;} public String isDeleted{get;set;} public String country{get;set;} }
3. Create an Apex Class ( MainVFController_AC )
public class MainVFController_AC { public String ConsoleWrapperJson{get;set;} public List ConsoleWrapperList{get;set;} public void Performcallout(){ HttpRequest req = new HttpRequest(); HttpResponse res = new HttpResponse(); Http http = new Http(); req.setEndpoint ('https://raw.githubusercontent.com/
parthiban019 /samplejson/master/ Console'); req.setMethod('GET'); res = http.send(req); if(res.getstatusCode() == 200 && res.getbody() != null) ConsoleWrapperList = (List)json.deserialize (res.getbody(),List.class); if(ConsoleWrapperList != null && ConsoleWrapperList.size() > 0) ConsoleWrapperJson= json.serialize(ConsoleWrapperList); } }
4. Create a Visualforce page (Main_VF)
This page is used for making callout and is the primary Visualforce page. Here, we are going to pass the data from this Visualforce page another Visualforce page
{!i}
5. Create an Apex class ( ChildController_AC )
public class ChildController_AC { public List consoleWrapperList{get;set;} public String response{get;set;} public void childconsolefunction(){ consoleWrapperList =(List)json.deserialize (response,List.class); } }
6. Create a Visualforce page (Child_VF)
In this Visualforce page, we are going get the data from the Main_VF page and display it in a tabular format.
{!i}
7. Detail Page Link
Create a Detail page link as shown in the below image for any of the objects. In this article, I have created a custom link in a custom object.
8. Service Cloud Application
Create a Service Cloud application and add the object that has a detail page link. When you open any record of that custom object, you will see the Custom Links value.
9. Execute the Main Visualforce page
Click the Custom Link and it navigates to new Console tab with the data from the external System.
(I.e https://raw.githubusercontent.com/ parthiban019/samplejson/ master/Console )
10. Pass Data from one Console tab to another
Click the button “Pass Data to the New Console Tab” and the data shown in the current Visualforcepage are passed to the Child_VF page using the Console integration toolkit.
Reference: Salesforce Console Integration Toolkit