• Prashanth Kumar Singh Poorna Singh
  • NEWBIE
  • 10 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 7
    Questions
  • 6
    Replies
Hello,

As you all know, From Summer '15 - End of Support for JavaScript, iFrames, CSS, and Other Advanced Markup in HTML Area Home Page Components. 
https://help.salesforce.com/apex/HTViewSolution?urlname=Summer-15-End-of-Support-for-JavaScript-iFrames-CSS-and-Other-Advanced-Markup-in-HTML-Area-Home-Page-Components&language=en_US

I have couple of Custome home page components of HTML Area Type and I have to convert it to Visualforce Area. To do this I need to create a VF page and replace the below code in VF page. Can any open help me to convert the bellow code to VF page, Please?


<?xml version="1.0" encoding="UTF-8"?>
<HomePageComponent xmlns="http://soap.sforce.com/2006/04/metadata">
    <body>&lt;br&gt;&lt;meta http-equiv=&quot;Refresh&quot; content=&quot;0;URL=/apex/PortalHomePage2&quot;&gt;&lt;script type=&quot;text/javascript&quot;&gt;&lt;!--function redirect () { setTimeout(&quot;go_now()&quot;,10000); }function go_now ()   { window.location.href = &quot;/apex/PortalHomePage2&quot;; }//--&gt;&lt;/script&gt;</body>
    <pageComponentType>htmlArea</pageComponentType>
    <width>wide</width>
</HomePageComponent>

It will be really help ful if I get any guideness on this. 
Public Class JSONParseDisplay{


Public Static void ParseJSON() {

  
  String Jsonstrn = '{"userDevices":[{"asserts":[" 2015-8-06 22:48:00"," 2015-8-06 22:48:00"],"battery":{"percentage":20,"voltage":3745},"deviceId":29308103,"deviceSerialNumber":"12EB5676534B","deviceType":"Charge HR","deviceWireId":"eb5672212b12","fwVersionRaw":"APP18.84 BSL18.84","hardwareVersion":"9","lastSyncClient":"api/sync-CLIENT-VISIBLE/mobile-ios/401","lastSyncedAt":"2015-08-10T13:27:56.000Z","pairedAt":"2015-04-10T19:51:15.000Z","pairedToEmail":"afit@somewhere.com"}]}';

//String Jsonstrn = '{"userDevices":[' +'{"asserts":[" 2015-8-06 22:48:00"," 2015-8-06 22:48:00"],"battery":[' +'{"percentage":20,"voltage":3745}],"deviceId":29308103,"deviceSerialNumber":"12EB5676534B","deviceType":"Charge HR","deviceWireId":"eb5672212b12","fwVersionRaw":"APP18.84 BSL18.84","hardwareVersion":"9","lastSyncClient":"api/sync-CLIENT-VISIBLE/mobile-ios/401","lastSyncedAt":"2015-08-10T13:27:56.000Z","pairedAt":"2015-04-10T19:51:15.000Z","pairedToEmail":"afitbitter@somewhere.com"}' +']}';

   JSONParser parser = JSON.createParser(Jsonstrn);
   System.debug('parser' +parser);
   while (parser.nextToken() != null) {
   
     if (parser.getCurrentToken() == JSONToken.START_ARRAY) {
     
         while (parser.nextToken() != null) {
         
          if (parser.getCurrentToken() == JSONToken.START_OBJECT) {
          
          
          UserDevice usd = (UserDevice)parser.readValueAs(UserDevice.class);
          System.debug('usd++ : ' +usd);
          System.debug('pairedAt: ' +usd.pairedAt);
          
         // System.debug('Size of batteries: ' +usd.batteries.size());
          System.debug('batteries: ' +usd.batteries);
          
          String s = JSON.serialize(usd);
          System.debug('Serialized invoice: ' + s);
          
          parser.skipChildren();
              
           }
              
        }

     } 
    
   }

 }
 
 public class UserDevice {
        
        List<string> asserts;
       List<battery> batteries;
      // List<string> batteries;
        public Double deviceId;
        public string deviceSerialNumber;
        public string deviceType;
        public string deviceWireId;
        public string fwVersionRaw;
        public Double hardwareVersion;
        public string lastSyncClient;
        public string lastSyncedAt;
        public string pairedAt;
        public string pairedToEmail;
        
        public UserDevice(List<string> asser,List<battery> batt,Double devId,string deviceSerNumber,string devType,string devWireId,string fwVersRaw,Double hardVersion,string lastSyClient,string lastSyedAt,string paredAt,string paredToEmail){
        
        asserts = asser;
       batteries = batt.clone();
       // batteries = Double.parseDouble(batt);
      // batteries = batt;
      //  System.debug('batt.clone(): ' +batt.clone());
        deviceId = devId;
        deviceSerialNumber = deviceSerNumber;
        deviceType = devType;
        deviceWireId = devWireId;
        fwVersionRaw = fwVersRaw;
        hardwareVersion = hardVersion;
        lastSyncClient = lastSyClient;
        lastSyncedAt = lastSyedAt;
        pairedAt = paredAt;
        pairedToEmail = paredToEmail;
        
        System.debug('pairedToEmail: ' +pairedToEmail);
   }     
 
 }
 
 public class battery {
        public Double percentage;
        public Double voltage;
        //System.debug('voltage::' +voltage);     
 
 
 } 


}
Hello , 

I am trying to write a simple Batch Apex class with the query below but not able to save , As I am getting error. Can anyone please help me.

global class Batch_VolunteerStatus implements Database.Batchable<sObject> {
    
    public String query = ''; 
    
    global Database.QueryLocator start(Database.BatchableContext BC){
        query = 'SELECT Id,Last_Background_Check_Date__c,Last_Background_Check_Status__c,Background_Check_Valid1__c,Name,Volunteer_Status__c' +
                 'FROM Contact' + 
                 'WHERE Volunteer_Status__c != \'' + Do Not Pursue + '\'' +
                  'AND  Last_Background_Check_Status__c != \'' + Fail + '\'' + 
                  'AND Background_Check_Valid1__c = \'' + false + '\''; 
        

      return Database.getQueryLocator(query);
   }
   
   global void execute(Database.BatchableContext BC, List<Contact> DateexpiredContact)
    {
        
    }
    
    
    global void finish(Database.BatchableContext BC) 
    {
    }
   

}

Getting error as 
Compilation error: unexpected token: 'Do'    
Hello,

In our Org, we have a custom Object called "Events" which has many-to- many relationship with Contact. I was able to create a Custom button on Contacts to auto-populate "Additional To" field with emai ID of that contact. 
using below URL
"/_ui/core/email/author/EmailAuthor?rtype=003&p3_lkid={!EventContactJunction__c.Id}&retURL=%2F{!EventContactJunction__c.Id}&p24={!EventContactJunction__c.Contact_Email__c}&template_id="

But how to add custom button on Events object, to auto populate all the email ID of the contacts under this Events (Related list) ?
It will be great help if any one can help me in this!

Thank you,
Prashanth 
Hello,

Is it possible to dispay a same Contact Record, when clicked in one App, displayed as one Record type or VF page and clicked in other App as different Record type ( different Section and fields).
Please help me on this. 

Thank you in advance!
Hello All,

I have created a Custome object, then created Survery Questions as Custome fields. Then I created an VF page where I am using the Custom fields to get Survery response. I am able to save and create survery questions.
How can I relate  the Survery Questions Custom field to Live chat Transcript, Kindly help me here.

Below is the VF page code, How to save the Chat Key value to a Custom field ?

<apex:page showHeader="false" standardController="Chat_Survery_Question__c">



<style>
.page  {
  width: 400px;
  max-width: 1000px;
  overflow:scroll;
  overflow: -moz-scrollbars-vertical;
  overflow-y: auto;

}
.head-logo-cutom{
padding-left:125px;

}

</style>

<apex:form >
<apex:pageBlock id="squest">

<img
src="{!URLFOR($Resource.PrechatPeakimage)}"
alt="Pre chat" class="head-logo-cutom" /><br /> <br />

<h1>Thank you for using our Live Chat feature, Please provide your feedback on your Live Chat interaction</h1><br />
<apex:pageblockSection columns="1" >

1. How convenient was the Chat session? <br />
<apex:inputField value="{!Chat_Survery_Question__c.X1_How_convenient_was_the_Chat_session__c}" label=""/>
2. How well did the Chat Agent understand your needs, questions or concerns?
<apex:inputField value="{!Chat_Survery_Question__c.X2_How_well_did_the_Chat_Agent_understan__c}" label=""/>
3. How satisfactory was the Chat Agent response time?
<apex:inputField value="{!Chat_Survery_Question__c.X3_How_satisfactory_was_the_Chat_Agent_r__c}" label=""/>
4. How many of your questions or concerns were resolved in the Chat Agent session?
<apex:inputField value="{!Chat_Survery_Question__c.X4_How_many_of_your_questions_or_concern__c}" label="" />
5. How likely are you to use Chat again on the PEAK website?
<apex:inputField value="{!Chat_Survery_Question__c.X5_How_likely_are_you_to_use_Chat_again__c}" label=""/>
6. If you have additional comments about your chat experience please include them here:
<apex:inputField value="{!Chat_Survery_Question__c.X6_If_you_have_additional_comments_about__c}" label="" style="width:300px"/>

</apex:pageblockSection>

Chat Key: <apex:outputText value="{!$CurrentPage.parameters.chatKey}" /><br />       
          
                      <apex:commandButton value="Save" action="{!save}" style="width:70px" />
  
                   

</apex:pageBlock>
</apex:form>

</apex:page>


Hi FinnaArildFluido,

Can you please share some demo code related to Post-Chat forms that sore value to transcript.

Thank you inadvance!
Public Class JSONParseDisplay{


Public Static void ParseJSON() {

  
  String Jsonstrn = '{"userDevices":[{"asserts":[" 2015-8-06 22:48:00"," 2015-8-06 22:48:00"],"battery":{"percentage":20,"voltage":3745},"deviceId":29308103,"deviceSerialNumber":"12EB5676534B","deviceType":"Charge HR","deviceWireId":"eb5672212b12","fwVersionRaw":"APP18.84 BSL18.84","hardwareVersion":"9","lastSyncClient":"api/sync-CLIENT-VISIBLE/mobile-ios/401","lastSyncedAt":"2015-08-10T13:27:56.000Z","pairedAt":"2015-04-10T19:51:15.000Z","pairedToEmail":"afit@somewhere.com"}]}';

//String Jsonstrn = '{"userDevices":[' +'{"asserts":[" 2015-8-06 22:48:00"," 2015-8-06 22:48:00"],"battery":[' +'{"percentage":20,"voltage":3745}],"deviceId":29308103,"deviceSerialNumber":"12EB5676534B","deviceType":"Charge HR","deviceWireId":"eb5672212b12","fwVersionRaw":"APP18.84 BSL18.84","hardwareVersion":"9","lastSyncClient":"api/sync-CLIENT-VISIBLE/mobile-ios/401","lastSyncedAt":"2015-08-10T13:27:56.000Z","pairedAt":"2015-04-10T19:51:15.000Z","pairedToEmail":"afitbitter@somewhere.com"}' +']}';

   JSONParser parser = JSON.createParser(Jsonstrn);
   System.debug('parser' +parser);
   while (parser.nextToken() != null) {
   
     if (parser.getCurrentToken() == JSONToken.START_ARRAY) {
     
         while (parser.nextToken() != null) {
         
          if (parser.getCurrentToken() == JSONToken.START_OBJECT) {
          
          
          UserDevice usd = (UserDevice)parser.readValueAs(UserDevice.class);
          System.debug('usd++ : ' +usd);
          System.debug('pairedAt: ' +usd.pairedAt);
          
         // System.debug('Size of batteries: ' +usd.batteries.size());
          System.debug('batteries: ' +usd.batteries);
          
          String s = JSON.serialize(usd);
          System.debug('Serialized invoice: ' + s);
          
          parser.skipChildren();
              
           }
              
        }

     } 
    
   }

 }
 
 public class UserDevice {
        
        List<string> asserts;
       List<battery> batteries;
      // List<string> batteries;
        public Double deviceId;
        public string deviceSerialNumber;
        public string deviceType;
        public string deviceWireId;
        public string fwVersionRaw;
        public Double hardwareVersion;
        public string lastSyncClient;
        public string lastSyncedAt;
        public string pairedAt;
        public string pairedToEmail;
        
        public UserDevice(List<string> asser,List<battery> batt,Double devId,string deviceSerNumber,string devType,string devWireId,string fwVersRaw,Double hardVersion,string lastSyClient,string lastSyedAt,string paredAt,string paredToEmail){
        
        asserts = asser;
       batteries = batt.clone();
       // batteries = Double.parseDouble(batt);
      // batteries = batt;
      //  System.debug('batt.clone(): ' +batt.clone());
        deviceId = devId;
        deviceSerialNumber = deviceSerNumber;
        deviceType = devType;
        deviceWireId = devWireId;
        fwVersionRaw = fwVersRaw;
        hardwareVersion = hardVersion;
        lastSyncClient = lastSyClient;
        lastSyncedAt = lastSyedAt;
        pairedAt = paredAt;
        pairedToEmail = paredToEmail;
        
        System.debug('pairedToEmail: ' +pairedToEmail);
   }     
 
 }
 
 public class battery {
        public Double percentage;
        public Double voltage;
        //System.debug('voltage::' +voltage);     
 
 
 } 


}
Hello,

Is it possible to dispay a same Contact Record, when clicked in one App, displayed as one Record type or VF page and clicked in other App as different Record type ( different Section and fields).
Please help me on this. 

Thank you in advance!

I am currently integrating Live Agent in Salesforce. I have created Post-Chat page, however I need to integrated an "Exit Survey" in the Post-Chat page. I do not have strong knowledge in HTML and Javascript and not sure what the code should look like to create the "Exiti Survey". Here is the information that I would like to display:

 

Exit Survey:

Content that will be displayed before and after the survey is submitted:

Thank you for your interest in our products and services. 

Body Text:

Please complete a  quick suvey to rate our online customer service chat. 

Headline Tex (displayed after submission)

Body Test (displayed after submission)

Pacific Power online chat is available 8 am -4:30pm PST-Monday to Friday. 

Field 1:

How would you rate yoiur overall experience?

Select Field:

Exemplary

Satisfactory 

Disaapointing 

Field 2 

Please include any comments:

Text Field Here

Survey window closing after 1 minute 

 

Here is the the Visual Markup that I have for the Post Chat Page:

 

<apex:page showHeader="false">
<h1>Post Chat Page</h1>
<!-- These variables are passed to the post-chat page and can be used to customize your
post-chat experience -->
Request Time: <apex:outputText value="{!$CurrentPage.parameters.requestTime}" /><br/>
Start Time: <apex:outputText value="{!$CurrentPage.parameters.startTime}" /><br/>
Button Id: <apex:outputText value="{!$CurrentPage.parameters.buttonId}" /><br/>
Deployment Id: <apex:outputText value="{!$CurrentPage.parameters.deploymentId}" /><br/>
Last Visited Page: <apex:outputText value="{!$CurrentPage.parameters.lastVisitedPage}"
/><br/>
Original Referer: <apex:outputText value="{!$CurrentPage.parameters.originalReferrer}"
/><br/>
Latitude: <apex:outputText value="{!$CurrentPage.parameters.latitude}" /><br/>
Longitude: <apex:outputText value="{!$CurrentPage.parameters.longitude}" /><br/>
City: <apex:outputText value="{!$CurrentPage.parameters.city}" /><br/>
Region: <apex:outputText value="{!$CurrentPage.parameters.region}" /><br/>
Country: <apex:outputText value="{!$CurrentPage.parameters.country}" /><br/>
Organization: <apex:outputText value="{!$CurrentPage.parameters.organization}" /><br/>
Transcript: <apex:outputText value="{!$CurrentPage.parameters.transcript}" /><br/>
Disconnected By: <apex:outputText value="{!$CurrentPage.parameters.disconnectedBy}"
/><br/>
Error: <apex:outputText value="{!$CurrentPage.parameters.error}" />
<!-- Implement your post-chat message, form, or survey here -->
</apex:page>

 

 

I appreciate any help I can get!

 

Thank you!

 

This should not be confused with my previous message related to the pre-chat form.

 

In the post chat form of Live Agent, the developer documentation provides an example of how to spit out some values about the chat (like that would be even remotely interesting to the customer) and at the end there's the fantastically unhelpful comment: <!-- Implement your post-chat message, form, or survey here -->

 

Nowhere does it say how I can get hold of the transcript object to store the values. I just want to implement a simple customer satisfaction form in the post-chat.

 

Does anyone have any pointers or examples of how this can be accomplished? 

 

Thanks, Finn Arild.