You need to sign in to do that
Don't have an account?
RarLopz
JSON2Apex
json response
Using Json2Apex I got this class,
e.g caPerformanceRecordList MonthtoDate(SubmittedCount) = 17
ecPerformanceRecordList:
MonthtoDate(Total: caBookedCount) = 2
MonthtoDate(Total: ecBookedCount) = 0
What do i need to change in the wrapper class to be able to calculate these sums and then reference in visualforce page ?
Thanks you .
{ "caPerformanceRecordList": [ { "sourceOneDealerID": "XL1HX", "dealerName": "Superior Auto Dealer", "reportingPeriod": "2019-06-25", "financeSourceIntegrationTypeCode": "FIFS", "independentdlrPlus": "Y", "caApplicationSourceCode": "ECKNWNSPT", "submissionCount": 1 }, { "sourceOneDealerID": "XL1HX", "dealerName": "Superior Auto Dealer", "reportingPeriod": "2019-06-25", "financeSourceIntegrationTypeCode": "PIFS", "independentdlrPlus": "Y", "caApplicationSourceCode": "RTEONE", "submissionCount": 1 }, { "sourceOneDealerID": "XL1HX", "dealerName": "Superior Auto Dealer", "reportingPeriod": "2019-06-26", "financeSourceIntegrationTypeCode": "FIFS", "independentdlrPlus": "Y", "caApplicationSourceCode": "RTEONE", "submissionCount": 15 } ], "ecPerformanceRecordList": [ { "sourceOneDealerID": "XL1HX", "submitUserID": "ECUSER1", "bookedDate": "2019-05-22 00:00:00.0", "ecEligible": "Y", "caBookedCount": 1, "ecBookedCount": 0 }, { "sourceOneDealerID": "XL1HX", "submitUserID": "ECUSER1", "bookedDate": "2019-06-05 00:00:00.0", "ecEligible": "Y", "caBookedCount": 1, "ecBookedCount": 0 } ] }
Using Json2Apex I got this class,
public class JSON2ApexWrapper { public class EcPerformanceRecordList { public String sourceOneDealerID; public String submitUserID; public String bookedDate; public String ecEligible; public Integer caBookedCount; public Integer ecBookedCount; } public class CaPerformanceRecordList { public String sourceOneDealerID; public String dealerName; public String reportingPeriod; public String financeSourceIntegrationTypeCode; public String independentdlrPlus; public String caApplicationSourceCode; public Integer submissionCount; } public List<CaPerformanceRecordList> caPerformanceRecordList; public List<EcPerformanceRecordList> ecPerformanceRecordList; public static JSON2ApexWrapper parse(String json) { return (JSON2ApexWrapper) System.JSON.deserialize(json,JSON2ApexWrapper.class); } }I want to create a Visualforce page to display a table adds the submissionCount for each day in the list and dislays the total
e.g caPerformanceRecordList MonthtoDate(SubmittedCount) = 17
ecPerformanceRecordList:
MonthtoDate(Total: caBookedCount) = 2
MonthtoDate(Total: ecBookedCount) = 0
What do i need to change in the wrapper class to be able to calculate these sums and then reference in visualforce page ?
Thanks you .
- I read your problem and implemented it in my Org and it is working fine.
- Please use the below code [Solved] : -
I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.
Thanks and Regards,
Deepali Kulshrestha.