Step1:
Create Corona Cases Object with the below fields.
Create Corona Cases Object with the below fields.
State__c,
State_Code__c,
Confirmed__c,
Active__c,
Recovered__c,
Deaths__c,
Today_New_Cases__c,
Today_Recovered__c,
Today_Deaths__c,
Last_Updated_Time__c
Step2:
Register the Open Source API site under Remote Site Settings
Step3:
Create a Callout class in Salesforce using REST API to call the Opensource API from https://api.covid19india.org/data.json
Callout Class:
https://github.com/NagarjunaKaipu/myLightning/blob/master/CovidInfoCallOuts.apxc
JSON2APEX Class.
https://github.com/NagarjunaKaipu/myLightning/blob/master/CovidJson.apxc
Sample JSON from Third-party Application.
https://github.com/NagarjunaKaipu/myLightning/blob/master/ThirdpartyRESTAPIJson.json
Step4:
Create a Schedulable class to run the callout class in the frequent intervals.
https://github.com/NagarjunaKaipu/myLightning/blob/master/ScheduleRefreshCovid.apxc
Step5:
Create Visualforce page to show the List of records on UI.
VF page:
https://github.com/NagarjunaKaipu/myLightning/blob/master/CovidStatus.vfp
Controller class:
https://github.com/NagarjunaKaipu/myLightning/blob/master/CovidStatusController.apxc
Step6:
Go to Sites and Configure the site as shown below
Site Home Page as your Visulaforce page
Go to Public Access Settings and give access to
Corona Cases object
Visualforce page
Controller class
Step7:
Activate the Site and your site URL looks like below
https://covid19india-developer-edition.ap4.force.com/CovidStatus
Sample Output:
State_Code__c,
Confirmed__c,
Active__c,
Recovered__c,
Deaths__c,
Today_New_Cases__c,
Today_Recovered__c,
Today_Deaths__c,
Last_Updated_Time__c
Step2:
Register the Open Source API site under Remote Site Settings
Step3:
Create a Callout class in Salesforce using REST API to call the Opensource API from https://api.covid19india.org/data.json
Callout Class:
https://github.com/NagarjunaKaipu/myLightning/blob/master/CovidInfoCallOuts.apxc
JSON2APEX Class.
https://github.com/NagarjunaKaipu/myLightning/blob/master/CovidJson.apxc
Sample JSON from Third-party Application.
https://github.com/NagarjunaKaipu/myLightning/blob/master/ThirdpartyRESTAPIJson.json
Step4:
Create a Schedulable class to run the callout class in the frequent intervals.
https://github.com/NagarjunaKaipu/myLightning/blob/master/ScheduleRefreshCovid.apxc
Step5:
Create Visualforce page to show the List of records on UI.
VF page:
https://github.com/NagarjunaKaipu/myLightning/blob/master/CovidStatus.vfp
Controller class:
https://github.com/NagarjunaKaipu/myLightning/blob/master/CovidStatusController.apxc
Step6:
Go to Sites and Configure the site as shown below
Site Home Page as your Visulaforce page
Go to Public Access Settings and give access to
Corona Cases object
Visualforce page
Controller class
Step7:
Activate the Site and your site URL looks like below
https://covid19india-developer-edition.ap4.force.com/CovidStatus
Sample Output:
Comments