Hi i am new to the requirement as i need to create the JSON from the APEX in the Below format: JSON Format:
{
"securiandocnumber": [
"3970118"
"3987556"
],
"caseId": "123"
}
Below is the class i have created requesting you to help me out to create the JSON:
public class SFG_CasePostWebService {
public SFG_CasePostWebService(){
}
@future(callout=true)
public static void frameCaseWebService(){
//Query out the data from Salesforce database.
List<Case> caseList = new List<Case>();
caseList=[Select id From Case];
Case_Associated_Document__c[] caseAssoDoc = [SELECT Id, Document_Id__c FROM Case_Associated_Document__c WHERE Service_Request__r.Id = :caseList];
//Formation of the JSON
}
public class CaseDetails {
public String[] securianDocNumbers;
public String caseId;
}
}
Forget to mention : Document_Id__c == securiandocnumber caseId = Id(From Case)