This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class RestCalloutDemo { | |
public string weatherJSON; | |
public string city{get;set;} | |
public WeatherWrapper ww{get;set;} | |
public pageReference requiredWeatherJSON() | |
{ | |
//Step 1: Create a http request object | |
Http httpProtocol = new Http(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class JSONParserDemo { | |
//Considering the same JSON from previous post but only with two questions | |
String jsonstring ='{"Questions": {"Question": [{"Q": "Which of the following is a responsibility of Supplier Management?","o1": "Development, negotiation and agreement of Operational Level Agreements (OLAs)","o2": "Development, negotiation and agreement of the Service Portfolio", "o3": "","a": "Development, negotiation and agreement of contracts","ua": "NA"},{ "Q": "Which of the following does the Availability Management process include? 1. Ensuring services are able to meet availability targets 2. Monitoring and reporting actual availability 3. Improvement activities, to ensure that services continue to meet or exceed their availability goals", "o1": "1 and 2 only","o2": "1 and 3 only","o3": "","a": "All the Above","ua": "NA"}]}}'; | |
List<QuestionsWrapper> parsedquestions = new List<QuestionsWrapper>(); | |
public List<QuestionsWrapper> getParsedquestions(){ | |
// Create |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class InputfieldDemoController { | |
//Variable under test | |
public String valuefromJS {get; set;} | |
public pagereference someMethod(){ | |
System.debug(valuefromJS); | |
return null; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="it"> | |
<head> | |
<meta charset="utf-8" /> | |
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;"/> | |
<title> | |
JavaScript to find duplicates in JSON file | |
</title> | |