• VinodKR
  • NEWBIE
  • 204 Points
  • Member since 2012

  • Chatter
    Feed
  • 6
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 32
    Replies
Hi,

I want to return two diffenrent datatypes from custom wsdl, for that I have created a Wrapper class inside the custom wsdl and return two different datatypes. Below is my code.

Global class GetOpportunityId
{
 Global class Response{    
        Global String Message;
        Global Boolean Status;
   }  
  WebService static Response getOppFromVC(Opportunity OppParam,Account AccParam)
    {
    Response Res = New Response();   
    -------
    my Apex code here            
    ---------
    --------
    Res.Message = 'Upated Successfully';
    Res.status = True;
    return Res;
     }    
}


My wsdl:

<xsd:complexType name="Response">
<xsd:sequence/>
</xsd:complexType>

In the above XML the attributes like Message and Status are missing. How to get those attributes. Please it's some urgent.

Thanks in advance.
I am calling a rest API from javascript from third party appplication outside salesforce and  getting this issue:-

XMLHttpRequest cannot load https://login.salesforce.com/services/oauth2/token. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost' is therefore not allowed access. The response had HTTP status code 400.


My Code:- 
$.ajax({
                    type: 'GET',
                    url: 'https://login.salesforce.com/services/oauth2/token',
                    contentType: 'application/json',
                    dataType: 'json',
                    beforeSend: function(xhr) {
                        xhr.setRequestHeader('grant_type','password'),
                        xhr.setRequestHeader('client_id',  'CLIENT_ID'),
                        xhr.setRequestHeader('client_secret', 'LIENT_SECRET'),
                        xhr.setRequestHeader('username', 'Username'),
                        xhr.setRequestHeader('password', "Password+securityToken")
                    },
                    success: function(response) {
                        console.log('Successfully retrieved ' + response);
                        //Other logic here
                    },
                    error: function(response) {
                        console.log('Failed ' + response.status + ' ' + response.statusText);
                        //Other logic here
                    }
                });


I have made an Connected app adn provide access to that user in Profile settings.

Here are some of my questions:-
1. The callback url in connected app can be http://localhost or should be a proper server URL.
2. Do i need to add http://localhost(server URL) in CORS and REMOTE settings
3. Server URL should be HTTPS (secured)

Please help me in this.

Thanks in advance!
4. I mentioned my error above , please help me in resolving it.
                

 
i added command button for every coloum in apex:repeat, if i click on that button then it is invoking wrapper class and displaying the wrapper class rows to all records in apex:repeat ....  i want to only display the wrapper class rows for the specific row only (at which i clicked the button).  please help me. 

The below image is after i cliking on "Add Row" botton on 1st row
User-added image
<apex:page controller="createDynamicTableProcess" >
<apex:form >
<apex:pageblock title="All contacts" >
<apex:repeat value="{!cons}" var="a" >
<table border="1" width="300px;" > <tr> 
<td><apex:outputtext value="{!a.name}" /> <br/></td>
<td><apex:outputtext value="{!a.phone}" /><br/></td>
<td><apex:outputtext value="{!a.account.industry}" /><br/></td>
<td><apex:commandbutton value="Add Row" action="{!createRecordForSubContact}" >
<apex:param name="sending contact id" value="{!a.id}" assignto="{!contactid}" />
</apex:commandbutton>
<br/><br/></td>

</tr> </table> 
  <apex:pageblocktable value="{!scw}" var="a" id="pbt1">
            <apex:column ><apex:inputcheckbox value="{!a.flag}" /> </apex:column>
            <apex:column ><apex:inputtext value="{!a.name}" onchange="getrec(this.id)" id="v1"/> </apex:column>
            <apex:column ><apex:inputtext value="{!a.country}" onchange="getrec(this.id)" id="v2"/> </apex:column>
   </apex:pageblocktable>

</apex:repeat>
</apex:pageblock>
</apex:form>


</apex:page>
 
public class createDynamicTableProcess {

public list<contact> cons{set;get;}
public string contactid {set;get;}
public list<subcontactwrapper> scw{set;get;}
public createDynamicTableProcess ()
{
    cons=new list<contact>();

    list<string> accids=new list<string>();
        for(account a1:[select id from account])
            {
            accids.add(a1.id);
            }

       cons=[select id,name,phone,account.industry from contact where accountid in:accids limit 10];
} //constructor closed

//method for button click for every contact.
public void createRecordForSubContact()
{
scw=new list<subcontactwrapper>();
subcontactwrapper s1=new subcontactwrapper();
scw.add(s1);


}

public class subcontactwrapper
{
public boolean flag {set;get;}
public string name {set;get;}
public string country {Set;get;}
public date  startdate {Set;get;} 
}
}

 
Hi,
I am new in Sforce developer programming, How to use webservices in salesforce and what are the steps to follow .
plz help me out....
Thanks!
Hi everyone,
    I am getting error  " Unknown property 'customref.Account' " in  VisualForce Page. Please review the code.
Let me know where i did mistake.

Thanks in Advance,
SivaSankari

Apex Code:
Public with sharing class customref{
 Public List<Account> acc{get;set;} 
    public String imageURL{get;set;}
 Public String searchStr{get;set;} // find a string

    /* display a image -method*/
 public  customref()
  {
    imageURL='/servlet/servlet.FileDownload?file=';
    List< document > documentList=[select name from document where 
                                    Name='logo'];
   
    if(documentList.size()>0)
    {
      imageURL=imageURL+documentList[0].id;
    }
  }
    
    /* find a string and  run the sosl query*/
  Public void soslDemo_method(){
   acc = New List<Account>();
 
   if(searchStr.length() > 1){
   String searchStr1 = searchStr;
       String searchQuery = 'FIND \'' + searchStr1 + '\' IN ALL FIELDS RETURNING  Account( Firstname,lastname )';
   List<List <sObject>> searchList = search.query(searchQuery);
   acc= ((List<Account>)searchList[0]);
       /* Message */
   if(acc.size() == 0){
       apexPages.addmessage(new apexpages.message(apexpages.severity.WARNING, 'Sorry, data not found'));
       return;
   }
   }
   else{
   apexPages.addmessage(new apexpages.message(apexpages.severity.Error, 'Please select the industry..'));
   return;
   }
  }
}

VF Code ;
<apex:page  controller="customref" tabstyle="Account" >
  <apex:form >
       <apex:image url="{!imageURL}">
    </apex:image>
      <apex:pageBlock title="Select a Industry" >
                 <apex:outputLabel value="Inustry:"/>
                 <apex:inputfield  value="{! Account.Industry}"/>   
    <apex:commandButton value="Submit" action="{!customref}"  />
   </apex:pageBlock>
    <apex:pageBlock title="Customer details">
    <apex:pageblockTable value="{!Account }" var="acc">
      
          <apex:column value="{!acc.Firstname}"/>
         <apex:column value="{!acc.lastname}"/>
          
       </apex:pageblockTable>
    </apex:pageBlock>
    </apex:form>
</apex:page>

 
Hi ,I'm trying to create a custom button in leads detail page that when clicked will populate a custom field called attampt date 1 with the current date. The attempt date 1 field is set up as a date field,and JS like this,but when clicked the button,it returned an error message like "A problem with the OnClick JavaScript for this button or link was encountered:expected token="
Can anyone help to find out the reason , thanks!!!

{!REQUIRESCRIPT("/soap/ajax/22.0/connection.js")} 

var newRecords = []; 

var c = new sforce.SObject("lead"); 
c.id ="{!Lead.Id}"; 
c.{!Lead.attempt1_date__c} = new Date().toISOString(); 
newRecords.push(c); 

result = sforce.connection.update(newRecords); 

window.location.reload();

Hi All,

 

I want to Disable or Remove Transfer closed opportunities check box in Ownership Edit page(Account) for a profile. 

 

Thanks

  VKR

How to make Ck editor read only mode in Visualforce page
Hello there,

I am having trouble using a controller extension, I don't seem to be able to get the record Id from the visualforce page.

I keep getting the error:
The name can only contain underscores and alphanumeric characters. It must begin with a letter and be unique, and must not include spaces, end with an underscore, or contain two consecutive underscores.

What I don't understand is that my VF Page is one word and does not have underscores or spaces.

Here is the VF Page:

<apex:page standardController="Account" recordSetVar="accounts" extensions="AccountActionCodes">
    {!$CurrentPage.parameters.Id}
     <apex:pageBlock title="Viewing Accounts">
        <apex:form id="theForm">
            <apex:pageBlockSection >
                <apex:dataList value="{!AccountActionCodes}" var="acct" type="1">
                    {!acct.name}
                </apex:dataList>
            </apex:pageBlockSection>
            <apex:panelGrid columns="2">
                <apex:commandLink action="{!previous}">Previous</apex:commandlink>
                <apex:commandLink action="{!next}">Next</apex:commandlink>
            </apex:panelGrid>
        </apex:form>
    </apex:pageBlock>
</apex:page>

And here is the controller extension:

public with sharing class AccountActionCodes {
    private final Account acct;  
    //create a private local handle for the standard controller
    private ApexPages.StandardSetController ctrl;


    // The constructor passes in the standard controller defined
    // in the markup below
    public AccountActionCodes(ApexPages.StandardSetController ctrlParam) {
        //assign from the passed in controller
        ctrl = ctrlParam;
    }    
    
    public List<Account> getAccountActionCodes() {
        Account theAccount = (Account)ctrl.getRecord();
        Id accountId = ApexPages.CurrentPage().getparameters().get('id');
        System.debug('Account id = ' + accountId);
    
        List<Account> accList = [SELECT Name FROM Account WHERE Id = :accountId]; 
         
        return accList;
    }
      
}

If I hardcode an Account Id in the SELECT query it works fine, but when it needs to get the Account Id from the VF Page it always sends the error message.

Any help appreciated...

 
Hi,

I'm trying to connect to an external webservice to retrieve information.When I try to call this webservice from a SOAP Client I recieve the information, but when I call the same web service from SalesForce I'm receiving the following error:

18:34:11.83 (2083320833)|CALLOUT_RESPONSE|[208]|System.HttpResponse[Status=Error Interno del Servidor, StatusCode=500] 18:34:11.83 (2123598734)|EXCEPTION_THROWN|[61]|System.XmlException: ParseError at [row,col]:[116,206] Message: The element type "HR" must be terminated by the matching end-tag "</HR>".

This is the code I'm currently using 
Blob headerValue = Blob.valueOf('user' +':' +'pass' );
 String authorizationHeader = 'Basic ' + EncodingUtil.base64Encode(headerValue); 
req.setHeader('Authorization', authorizationHeader); 
req.setMethod('POST');

I also would like to know how I'm suppose to use the WebServiceCallout.invoke (https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_class_System_WebServiceCallout.htm) method with a user authentication.
 
Hi,

I want to return two diffenrent datatypes from custom wsdl, for that I have created a Wrapper class inside the custom wsdl and return two different datatypes. Below is my code.

Global class GetOpportunityId
{
 Global class Response{    
        Global String Message;
        Global Boolean Status;
   }  
  WebService static Response getOppFromVC(Opportunity OppParam,Account AccParam)
    {
    Response Res = New Response();   
    -------
    my Apex code here            
    ---------
    --------
    Res.Message = 'Upated Successfully';
    Res.status = True;
    return Res;
     }    
}


My wsdl:

<xsd:complexType name="Response">
<xsd:sequence/>
</xsd:complexType>

In the above XML the attributes like Message and Status are missing. How to get those attributes. Please it's some urgent.

Thanks in advance.
what's the before insert and after insert example
Hi 
can I change my site domain http:/test-developer-edition.ap2.force.com/  to something like www.devtest.force.com or Any easy name.
Thanks 
Abhilash Mishra 
Hi All,

Can you suggest me the way to parse the excel attachment or convert the CSV to Excel using Apex code.


 
I'm connecting to Mavenlink to pull time cards  and running the below code in the Developer Console.  2/3s down the page my last if-statement block of code causes the code to fail without any explanation.  Commenting out that if-statement block causes a successful execution.

I hope someone can help..I hope it's a silly little thing I missed and I can stop banging my head in the wall....
 
httpRequest reqWorkspaces = new httpRequest();
reqWorkspaces.setMethod('GET');
reqWorkspaces.setEndpoint('https://api.mavenlink.com/api/v1/time_entries.json'+
                          '?created_after=2015-08-01T000000&created_before=2015-08-16T000000&page=1&per_page=20');
reqWorkspaces.setHeader('Authorization', 'Bearer xxxxxxxx');
reqWorkspaces.setTimeout(120000);
httpResponse resWorkspaces = new http().send(reqWorkspaces);

JSONParser parserCount = JSON.createParser(resWorkspaces.getBody());
Integer iCountTimecards = 0;
Integer iNumberOfBatches = 0;

while(parserCount.nextToken() != null)
{
	if((parserCount.getCurrentToken() == JSONToken.FIELD_NAME) && (parserCount.getText() == 'count'))
    {
        parserCount.nextToken();
        iCountTimecards = Integer.valueOf(parserCount.getText());
    }
}

SYSTEM.DEBUG('+++++ iCountTimecards: ' + iCountTimecards);

Map<String, String> mapKeyValue = new Map<String, String>();
Map<String, Map<String, String>> mapJSON = new Map<String, Map<String, String>>();

if(iCountTimecards > 0)
{
	iNumberOfBatches = Math.round(iCountTimecards / 200) + 1;
    
SYSTEM.DEBUG('+++++ iNumberOfBatches: ' + iNumberOfBatches);

	reqWorkspaces.setTimeout(120000);
    
	for(Integer iBatchNum = 1; iBatchNum <= iNumberOfBatches; iBatchNum++) 
    {

		reqWorkspaces.setEndpoint('https://api.mavenlink.com/api/v1/time_entries.json'+
                                  '?created_after=2015-08-01T000000&created_before=2015-16-01T000000&page=' + iBatchNum );
	
		resWorkspaces = new http().send(reqWorkspaces);
		
		JSONParser parser = JSON.createParser(resWorkspaces.getBody());
        
		String strTCID = '';
		String strProjectID = '';
		String strUserID = '';
		String strApproved = '';
		String strBillable = '';
		String strCreatedAt = ''; 
		String strUpdatedAt = '';
		String strDatePerformed = '';
		String strTimeInMinutes = '';
		String strRateInCents = '';
		String strNotes = '';
		String strStoryID = '';
        
		while(parser.nextToken() != null) 
		{
		    if(parser.getCurrentToken() == JSONToken.FIELD_NAME) 
		    {
                if(parser.getText() == 'created_at')
                {
                    parser.nextToken();
                    strCreatedAt = parser.getText();
                }
                
                if(parser.getText() == 'updated_at')
                {
                    parser.nextToken();
                    strUpdatedAt = parser.getText();
                }
                
                if(parser.getText() == 'date_performed')
                {
                    parser.nextToken();
                    strDatePerformed = parser.getText();
                }
                
                if(parser.getText() == 'time_in_minutes')
                {
                    parser.nextToken();
                    strTimeInMinutes = parser.getText();
                }
                
                if(parser.getText() == 'billable')
                {
                    parser.nextToken();
                    strBillable = parser.getText();
                }
                
                if(parser.getText() == 'notes')
                {
                    parser.nextToken();
                    strNotes = parser.getText();
                }
                
                if(parser.getText() == 'rate_in_cents')
                {
                    parser.nextToken();
                    strRateInCents = parser.getText();
                }
                
                if(parser.getText() == 'approved')
                {
                    parser.nextToken();
                    strApproved = parser.getText();
                }
                
                if(parser.getText() == 'story_id')
                {
                    parser.nextToken();
                    strStoryID = parser.getText();
                }
                
                if(parser.getText() == 'workspace_id')
                {
                    parser.nextToken();
		        	strProjectID = parser.getText();
                }
		        		    		    
                if(parser.getText() == 'user_id') 
                {
                    parser.nextToken();
                    strUserID = parser.getText();
                }
                
 // Commenting out the next 'if' block causes a successful execution... leaving it as is
 // causes an unknown failure
                
                if(parser.getText() == 'id')
                {
                    parser.nextToken();
                    strTCID = parser.getText();
                    
                    mapKeyValue.put('id', strTCID);
                    mapKeyValue.put('workspace_id', strProjectID);
                    mapKeyValue.put('created_at', strCreatedAt);
                    mapKeyValue.put('updated_at', strUpdatedAt);
                    mapKeyValue.put('date_performed', strDatePerformed);
                    mapKeyValue.put('time_in_minutes', strTimeInMinutes);
                    mapKeyValue.put('billable', strBillable);
                    mapKeyValue.put('notes', strNotes);
                    mapKeyValue.put('rate_in_cents', strRateInCents);
                    mapKeyValue.put('approved', strApproved);
                    mapKeyValue.put('story_id', strStoryID);
                    mapKeyValue.put('user_id', strUserID);
                    
                    mapJSON.put(strTCID, mapKeyValue);
                    mapKeyValue.clear();
                    
                }

                
            } // if(parser.getCurrentToken() == JSONToken.FIELD_NAME) 

		} // while(parser.nextToken() != null) 
        
	} // for(Integer iBatchNum = 1; iBatchNum <= iNumberOfBatches; iBatchNum++) 
} // if(iCountTimecards > 0)

 
I am new to Visualforce and am struggling with something that should be easy. I am creating a complete custom page for a Community landing page. This is replacing an older page that was used on an existing customer portal page being phased out. I basically want a VisualForce page that has multiple tabs. Now the tabs are already created under Create/Tabs referencing their own VF pages. What I can't seem to figure out is how to call these tabs into the tabPanel/tab tags.

So I would expect to do something like this-
<tabPanel>
<tab name=customtabalreadycreated1></tab>
<tab name=customtabalreadycreated2></tab>
</tabPanel>

I can just as easily just copy and paste the code from the VF pages for each tab into the new page but then the code is very long and not very readable. Is this my only option or is there some way to reference the custom tabs in the tab panel of the new VF page?

Thanks

Hi All,

I'm getting Cross site Scripting (XSS) attack for the line strIdeaId = ApexPages.currentPage().getParameters().get('id'); Below is my code snippet. Please suggest me how to overcome this problem.
public  with sharing class TestController {
     String strIdeaId;
}
 public TestController () {
  strIdeaId = ApexPages.currentPage().getParameters().get('id');
}

I am calling a rest API from javascript from third party appplication outside salesforce and  getting this issue:-

XMLHttpRequest cannot load https://login.salesforce.com/services/oauth2/token. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost' is therefore not allowed access. The response had HTTP status code 400.


My Code:- 
$.ajax({
                    type: 'GET',
                    url: 'https://login.salesforce.com/services/oauth2/token',
                    contentType: 'application/json',
                    dataType: 'json',
                    beforeSend: function(xhr) {
                        xhr.setRequestHeader('grant_type','password'),
                        xhr.setRequestHeader('client_id',  'CLIENT_ID'),
                        xhr.setRequestHeader('client_secret', 'LIENT_SECRET'),
                        xhr.setRequestHeader('username', 'Username'),
                        xhr.setRequestHeader('password', "Password+securityToken")
                    },
                    success: function(response) {
                        console.log('Successfully retrieved ' + response);
                        //Other logic here
                    },
                    error: function(response) {
                        console.log('Failed ' + response.status + ' ' + response.statusText);
                        //Other logic here
                    }
                });


I have made an Connected app adn provide access to that user in Profile settings.

Here are some of my questions:-
1. The callback url in connected app can be http://localhost or should be a proper server URL.
2. Do i need to add http://localhost(server URL) in CORS and REMOTE settings
3. Server URL should be HTTPS (secured)

Please help me in this.

Thanks in advance!
4. I mentioned my error above , please help me in resolving it.
                

 
In the below class i want to know from where the method "updateFeedback" is calling in my organisation.

@RestResource(urlMapping='/UpdateFeedback/*')
global with sharing class SMXRestResource {
@HttpPost
global static String doPost(String strActionCode,Decimal decScore,String strComment,String strStatus,String strSubStatus,String strFeedbackReceivedDate,String strInvitationSentDate,String strFirstReminderDate,String strSecondReminderDate,String strThirdReminderDate, String strPersonId,String strDcname, String strDcid) 
{
     RestRequest req = RestContext.request;
     String strFbkId= req.requestURI.substring(req.requestURI.lastIndexOf('/')+1);
     strFbkId = EncodingUtil.urlDecode(strFbkId,'UTF-8');
     return updateFeedback(strFbkId,strActionCode,decScore,strComment,strStatus,strSubStatus,strFeedbackReceivedDate,strInvitationSentDate,strFirstReminderDate,strSecondReminderDate,strThirdReminderDate,strPersonId,strDcname,strDcid);         
 }
 
 public static String updateFeedback(String strFbkId,String strActionCode,Decimal decScore,String strComment,String strStatus,String strSubStatus,String strFeedbackReceivedDate,String strInvitationSentDate,String strFirstReminderDate,String strSecondReminderDate,String strThirdReminderDate,String strPersonId,String strDcname, String strDcid) {
     String strReturnVal = '';
     String strFeedbackReceivedDateParsed ='';
     String strInvitationSentDateParsed ='';
     String strFirstReminderDateParsed='';
     String strSecondReminderDateParsed='';
     String strThirdReminderDateParsed='';
     String strContactRecordStatus = 'Failure';
     String status, severity, subject, webServiceStatus;
     String IsAlert = 'N';
     String SurveyIDRef = '';
     
     List <Feedback__c> lstFeedback= [SELECT Id,DataCollectionId__c from Feedback__c where Name=:strFbkId];
    
    if(lstFeedback.isEmpty()){      
        //strContactRecordStatus=createSurveyRecord( strFbkId, strStatus, strPersonId, strSubStatus,strDcname,  strDcid);
        strContactRecordStatus = 'Failure - This Record is not Imported through SFDC';
    }
  • January 25, 2016
  • Like
  • 0
Apex Class :

public with sharing class AccountController {

    public String account { get; set; }

public List<SelectOption> getListOfAccounts()
{
           List<Account> AccountList = [select id,Name from Account] ;
           System.debug('Accounts'+AccountList.size());
           List<SelectOption> AccountOptionList = new List<SelectOption>();
           AccountOptionList .add(new SelectOption( ' ' ,'---Select---'));
           for(Account acc : AccountList )
           {
                      AccountOptionList .add(new SelectOption(acc.id , acc.Name));
           }
          return AccountOptionList ;
}

    public String selectedaccountId { get; set; }

    public AccountController() {

    }
}

VF Page :

<apex:page controller="AccountController">

<apex:form >
       <apex:pageBlock >
         <apex:pageBlockSection title="Select the Account" >
                      <apex:OutputPanel >
                                 <apex:selectList value="{!selectedaccountId}" size="1" multiselect="false" id="theSelectList" onChange="doChange(); return false;">
                                          <apex:selectOptions value="{!ListOfAccounts}" />
                                 </apex:selectList>
                                 <script> var options = document.getElementById("{!$Component.theSelectList}"); </script>
                        </apex:OutputPanel>
          </apex:pageBlockSection>
      </apex:pageBlock>
</apex:form>
<html>
  <head>
  
  <script type="text/javascript">
             var __sfdcSessionId = '{!GETSESSIONID()}';
    </script>
    <script src="../../soap/ajax/33.0/connection.js" type="text/javascript"></script>
    <script src="../../soap/ajax/24.0/apex.js" type="text/javascript"></script>
    
   <script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
   <script type="text/javascript">
   
   var noOfCase;
   function doChange(){
      var accId =options.value; 
       console.log('@@selectedaccountId=='+accId);
      // alert(options.value); 
      
      var caseQuery = sforce.connection.query(" select Id from case where AccountId= \'"+accId +"\' ");
      var case_records = caseQuery.getArray("records");
      noOfCase = +case_records.length;
      console.log('@@noOfCase =='+noOfCase);
      
      
   }
     
      google.charts.load('current', {'packages':['gauge']});
      google.charts.setOnLoadCallback(drawChart);
      function drawChart() {

       /* var data = google.visualization.arrayToDataTable([
         // ['Label', 'Value'],
          //['Memory', 80],
          //['CPU', 55],
          //['Network', 68]
        //]);
        */
        var data = new google.visualization.DataTable();
        data.addColumn('string', 'Cases'); // must be string
        data.addColumn('number', 'value');
        data.addRow(['Cases',noOfCase]);

        var options = {
          width: 400, height: 120,
          redFrom: 0, redTo: 33,
          yellowFrom: 34, yellowTo: 66,
          greenFrom: 67 , greenTo: 100
          minorTicks: 5 
          };

        var chart = new google.visualization.Gauge(document.getElementById('chart_div'));

        chart.draw(data, options);

        /*setInterval(function() {
          data.setValue(0, 1, 40 + Math.round(60 * Math.random()));
          chart.draw(data, options);
        }, 13000);
        setInterval(function() {
          data.setValue(1, 1, 40 + Math.round(60 * Math.random()));
          chart.draw(data, options);
        }, 5000);
        setInterval(function() {
          data.setValue(2, 1, 60 + Math.round(20 * Math.random()));
          chart.draw(data, options);
        }, 26000);*/
      }
    </script>
  </head>
  <body>
    <div id="chart_div" style="width: 400px; height: 120px;"></div>
  </body>
</html>
    
  
</apex:page>
     

The Google chart needs to be displayed with Case Count , upon selection of the Account Name .
Can you please help with the loading of the chart?                       
I want to fetch value in pick list instead of coloumn table





<apex:page controller="Calloutcontroller" sidebar="false" showheader="false" title="JSON table" >

<apex:form >
<apex:commandButton value="Proceed with Selected" action="{!ProceedWithSelected}"/>

<apex:pageBlock >
<apex:pageBlockTable value="{!performcallout}" var="wrap" width="100%"  rendered="{!normalList}">
<apex:column headerValue="Name" value="{!wrap.Name}"/>

<apex:column headerValue="AccountNumber" value="{!wrap.AccNumber}"/>

<apex:column headerValue="Source" value="{!wrap.Source}"/>

<apex:column headerValue="Website" value="{!wrap.Site}"/>

<apex:column headerValue="Email" value="{!wrap.Email}"/>
<apex:column >
                   <apex:inputCheckbox value="{!wrap.selected}"/>
</apex:column>

</apex:pageBlockTable>
<apex:panelGrid columns="2">
<apex:pageBlockTable value="{!selectedWrapperList}"  var="wrap" width="100%" rendered="{!selectedList}">

<apex:column headerValue="Name" value="{!wrap.Name}"/>

<apex:column headerValue="AccountNumber" value="{!wrap.AccNumber}"/>
<apex:column headerValue="Source" value="{!wrap.Source}"/>
</apex:pageBlockTable>

<apex:pageBlockTable value="{!selectedWrapperList}"  var="wrap" width="100%" rendered="{!selectedList}">

<apex:column headerValue="Website" value="{!wrap.Site}"/>

<apex:column headerValue="Email" value="{!wrap.Email}"/>
<apex:column >
                   <apex:inputCheckbox value="{!wrap.selected}"/>
</apex:column>

</apex:pageBlockTable>

<apex:commandButton value="Done"/>
</apex:panelGrid>
</apex:pageBlock>

</apex:form>

</apex:page>

------------------------------------Controller-------------------------------------------------


public class Calloutcontroller{


     public List<consolewrap> ConsoleWrapperList{get;set;} 
     public List<consolewrap> getperformcallout(){
      ConsoleWrapperList = new List<consolewrap>();
       HttpRequest req = new HttpRequest(); 
       HttpResponse res = new HttpResponse();
        Http http = new Http(); 
        req.setEndpoint('https://raw.githubusercontent.com/parthiban019/samplejson/master/student.json'); 
        req.setMethod('GET');
         res = http.send(req);
          if(res.getstatusCode() == 200 && res.getbody() != null){ ConsoleWrapperList=(List<consolewrap>)json.deserialize(res.getbody(),List<consolewrap>.class);
           }
            return consolewrapperlist; 
            }
            
            
            
             }