function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
RarLopzRarLopz 

Unknown Property: VisualforceArrayList

Save error: Unknown property 'VisualforceArrayList.caPerformanceRecordList'	
 
I am trying to create a VFP to display a table  with values from a JSONWrapperController Class. 

<apex:page controller="CASReportController">
    <apex:form >
        <apex:pageBlock title="JSON Deserialized Response"> 
            <apex:pageBlockButtons >
                <apex:commandButton value="submit" action="{!deserialize}" reRender="dealerBlock"/>
            </apex:pageBlockButtons>
           
           
           	<apex:pageBlockSection id="DealerBlock" columns="1">
                 <apex:repeat value="{!wrapper.caPerformanceRecordList}" var="cap">
                    
                  <apex:pageBlockSection columns="2">
                   <apex:facet name="header">Dealer Name {!cap.dealerName}</apex:facet>
                         <apex:pageBlockSectionItem >
                            <apex:outputLabel value="Dealer Id" for="dlrid" />
                            <apex:outputText value="{!cap.motorDealerID}" id="dlrid" />
                         </apex:pageBlockSectionItem>
                         <apex:pageBlockSectionItem >
                            <apex:outputLabel value="Reporting Date " for="rptdt" />
                            <apex:outputText value="{!cap.statementDate}" id="rptdt" />
                         </apex:pageBlockSectionItem>
                        </apex:pageBlockSection>
           
               
        		 </apex:repeat>
			</apex:pageBlockSection>                                                                                         
        </apex:pageBlock> 
    </apex:form>
</apex:page>


==================================

Related components for this visualforce page

This is a snapshot of the actual JSON Response from Endpoint as obtained from Postman: 

{
    "caPerformanceRecordList": [
        
        {
            "motorDealerID": "XL1HX",
            "dealerName": "Subaru Auto Dealer",
            "reportingPeriod": "2019-05-18",
            "financeSourceIntegrationTypeCode": "FIFS",
            "idlPlus": "Y",
            "creditApplicationSourceCode": "STEONE",
            "submissionCount": 2
        },
        {
            "motorDealerID": "XL1HX",
            "dealerName": "Subaru Auto Dealer",
            "reportingPeriod": "2019-06-27",
            "financeSourceIntegrationTypeCode": "FIFS",
            "idlPlus": "Y",
            "creditApplicationSourceCode": "STEONE",
            "submissionCount": 5
        }
    ],
    "ecPerformanceRecordList": [
        {
            "motorDealerID": "XL1HX",
            "submitUserID": "BCUSER1",
            "bookedDate": "2019-05-22 00:00:00.0",
            "ecEligible": "Y",
            "caBookedCount": 1,
            "ecBookedCount": 0
        },
        {
            "motorDealerID": "XL1HX",
            "submitUserID": "BCUSER1",
            "bookedDate": "2019-06-05 00:00:00.0",
            "ecEligible": "Y",
            "caBookedCount": 1,
            "ecBookedCount": 0
        }
    ]
}



=========================================================

public with sharing class CASReportController {
@AuraEnabled
		public list<JSONWrapperController> wrapper {get;set;}
		
		public void deserialize() {
		
			try{
				string jsonresponse = '[{ "caPerformanceRecordList": [ { "motorDealerID": "XL1HX", "dealerName": "Subaru Auto Dealer", "reportingPeriod": "2019-05-18", "financeSourceIntegrationTypeCode": "FIFS", "idlPlus": "Y", "creditApplicationSourceCode": "STEONE", "submissionCount": 2 }, { "motorDealerID": "XL1HX", "dealerName": "Subaru Auto Dealer", "reportingPeriod": "2019-06-27", "financeSourceIntegrationTypeCode": "FIFS", "idlPlus": "Y", "creditApplicationSourceCode": "STEONE", "submissionCount": 5 } ], "ecPerformanceRecordList": [ { "motorDealerID": "XL1HX", "submitUserID": "BCUSER1", "bookedDate": "2019-05-22 00:00:00.0", "ecEligible": "Y", "caBookedCount": 1, "ecBookedCount": 0 }, { "motorDealerID": "XL1HX", "submitUserID": "BCUSER1", "bookedDate": "2019-06-05 00:00:00.0", "ecEligible": "Y", "caBookedCount": 1, "ecBookedCount": 0 } ] }]';
			  
			 	system.debug('json string is ' +jsonresponse);
			 	wrapper = (list<JSONWrapperController>) JSON.deserialize(jsonresponse, list<JSONWrapperController>.class);
			 
		     	system.debug('This is the wrapper class: ' +wrapper);
			 } catch (Exception e){
				system.debug('Error---->' +  e.getLineNumber() + e.getMessage());
				
			}
       }
}

========================================

public class JSONWrapperController {

     public List<CaPerformanceRecordList> caPerformanceRecordList{get;set;}
     public List<EcPerformanceRecordList> ecPerformanceRecordList{get;set;}	
     
     public class EcPerformanceRecordList {
		public String motorDealerID{get;set;}
		public String submitUserID{get;set;}
		public String bookedDate{get;set;}
		public String ecEligible{get;set;}
		public Integer caBookedCount{get;set;}
		public Integer ecBookedCount{get;set;}
	}

	

	public class CaPerformanceRecordList {
		public String motorDealerID{get;set;}
		public String dealerName{get;set;}
		public String reportingPeriod{get;set;}
		public String financeSourceIntegrationTypeCode{get;set;}
		public String idlPlus{get;set;}
		public String creditApplicationSourceCode;
		{get;set;}public Integer submissionCount;
	}

	
	
}
Best Answer chosen by RarLopz
Deepali KulshresthaDeepali Kulshrestha
Hi RarLopz,

- I read your problem and implemented it in my Org and it is working fine.
- Please use the below code [Solved] : -
--------------VF Page------------------
 
<apex:page controller="CASReportController">
    <apex:form >
        <apex:pageBlock title="JSON Deserialized Response">
            <apex:pageBlockButtons >
                <apex:commandButton value="submit" action="{!deserialize}" reRender="DealerBlock"/>
            </apex:pageBlockButtons>

            <apex:pageBlockSection id="DealerBlock" columns="1">
                <apex:repeat value="{!wrapper}" var="cap1">
                    <apex:repeat value="{!cap1.caPerformanceRecordList}" var="cap">
                    <apex:pageBlockSection columns="2">
                        <apex:facet name="header">Dealer Name {!cap.dealerName}</apex:facet>
                        <apex:pageBlockSectionItem >
                            <apex:outputLabel value="Dealer Id" for="dlrid" />
                            <apex:outputText value="{!cap.motorDealerID}" id="dlrid" />
                        </apex:pageBlockSectionItem>
                        <apex:pageBlockSectionItem >
                            <apex:outputLabel value="Reporting Date " for="rptdt" />
                            <apex:outputText value="{!cap.reportingPeriod}" id="rptdt" />
                        </apex:pageBlockSectionItem>
                    </apex:pageBlockSection>

                        </apex:repeat>
                    <apex:repeat value="{!cap1.ecPerformanceRecordList}" var="cap">
                        <apex:pageBlockSection columns="2">
                            <apex:facet name="header">motorDealerID {!cap.motorDealerID}</apex:facet>
                            <apex:pageBlockSectionItem >
                                <apex:outputLabel value="submitUserID" for="dlrid" />
                                <apex:outputText value="{!cap.submitUserID}" id="dlrid" />
                            </apex:pageBlockSectionItem>
                            <apex:pageBlockSectionItem >
                                <apex:outputLabel value="bookedDate " for="rptdt" />
                                <apex:outputText value="{!cap.bookedDate}" id="rptdt" />
                            </apex:pageBlockSectionItem>
                        </apex:pageBlockSection>

                    </apex:repeat>
                </apex:repeat>
            </apex:pageBlockSection>
        </apex:pageBlock>
    </apex:form>
</apex:page>
-------------- Apex Controller------- -----
public with sharing class CASReportController {
    @AuraEnabled
    public list<JSONWrapperController> wrapper {get;set;}

    public void deserialize() {

        try{
            string jsonresponse = '[{ "caPerformanceRecordList": [ { "motorDealerID": "XL1HX", "dealerName": "Subaru Auto Dealer", "reportingPeriod": "2019-05-18", "financeSourceIntegrationTypeCode": "FIFS", "idlPlus": "Y", "creditApplicationSourceCode": "STEONE", "submissionCount": 2 }, { "motorDealerID": "XL1HX", "dealerName": "Subaru Auto Dealer", "reportingPeriod": "2019-06-27", "financeSourceIntegrationTypeCode": "FIFS", "idlPlus": "Y", "creditApplicationSourceCode": "STEONE", "submissionCount": 5 } ], "ecPerformanceRecordList": [ { "motorDealerID": "XL1HX", "submitUserID": "BCUSER1", "bookedDate": "2019-05-22 00:00:00.0", "ecEligible": "Y", "caBookedCount": 1, "ecBookedCount": 0 }, { "motorDealerID": "XL1HX", "submitUserID": "BCUSER1", "bookedDate": "2019-06-05 00:00:00.0", "ecEligible": "Y", "caBookedCount": 1, "ecBookedCount": 0 } ] }]';

            system.debug('json string is ' +jsonresponse);
            wrapper = (list<JSONWrapperController>) JSON.deserialize(jsonresponse, list<JSONWrapperController>.class);

            system.debug('This is the wrapper class: ' +wrapper);
        } catch (Exception e){
            system.debug('Error---->' +  e.getLineNumber() + e.getMessage());

        }
    }


public class JSONWrapperController {

public List < CaPerformanceRecordList > caPerformanceRecordList{
get;set;
}
public List < EcPerformanceRecordList > ecPerformanceRecordList{
get;set;
}
}
public class EcPerformanceRecordList {
public String motorDealerID{get;set;}
public String submitUserID{get;set;}
public String bookedDate{get;set;}
public String ecEligible{get;set;}
public Integer caBookedCount{get;set;}
public Integer ecBookedCount{get;set;}
}



public class CaPerformanceRecordList {
public String motorDealerID{get;set;}
public String dealerName{get;set;}
public String reportingPeriod{get;set;}
public String financeSourceIntegrationTypeCode{get;set;}
public String idlPlus{get;set;}
public String creditApplicationSourceCode{get;set;}
    public Integer submissionCount{get;set;}

}

}


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.

All Answers

Alain CabonAlain Cabon
@RarLopz

@AuraEnabled must be duplicated for each property that you want to expose.

https://developer.salesforce.com/docs/atlas.en-us.220.0.lightning.meta/lightning/controllers_server_apex_pass_data.htm
 
public class JSONWrapperController {
  @AuraEnabled
  public List<CaPerformanceRecordList> caPerformanceRecordList{get;set;}
  @AuraEnabled
  public List<EcPerformanceRecordList> ecPerformanceRecordList{get;set;}  
  ...

 
Deepali KulshresthaDeepali Kulshrestha
Hi RarLopz,

- I read your problem and implemented it in my Org and it is working fine.
- Please use the below code [Solved] : -
--------------VF Page------------------
 
<apex:page controller="CASReportController">
    <apex:form >
        <apex:pageBlock title="JSON Deserialized Response">
            <apex:pageBlockButtons >
                <apex:commandButton value="submit" action="{!deserialize}" reRender="DealerBlock"/>
            </apex:pageBlockButtons>

            <apex:pageBlockSection id="DealerBlock" columns="1">
                <apex:repeat value="{!wrapper}" var="cap1">
                    <apex:repeat value="{!cap1.caPerformanceRecordList}" var="cap">
                    <apex:pageBlockSection columns="2">
                        <apex:facet name="header">Dealer Name {!cap.dealerName}</apex:facet>
                        <apex:pageBlockSectionItem >
                            <apex:outputLabel value="Dealer Id" for="dlrid" />
                            <apex:outputText value="{!cap.motorDealerID}" id="dlrid" />
                        </apex:pageBlockSectionItem>
                        <apex:pageBlockSectionItem >
                            <apex:outputLabel value="Reporting Date " for="rptdt" />
                            <apex:outputText value="{!cap.reportingPeriod}" id="rptdt" />
                        </apex:pageBlockSectionItem>
                    </apex:pageBlockSection>

                        </apex:repeat>
                    <apex:repeat value="{!cap1.ecPerformanceRecordList}" var="cap">
                        <apex:pageBlockSection columns="2">
                            <apex:facet name="header">motorDealerID {!cap.motorDealerID}</apex:facet>
                            <apex:pageBlockSectionItem >
                                <apex:outputLabel value="submitUserID" for="dlrid" />
                                <apex:outputText value="{!cap.submitUserID}" id="dlrid" />
                            </apex:pageBlockSectionItem>
                            <apex:pageBlockSectionItem >
                                <apex:outputLabel value="bookedDate " for="rptdt" />
                                <apex:outputText value="{!cap.bookedDate}" id="rptdt" />
                            </apex:pageBlockSectionItem>
                        </apex:pageBlockSection>

                    </apex:repeat>
                </apex:repeat>
            </apex:pageBlockSection>
        </apex:pageBlock>
    </apex:form>
</apex:page>
-------------- Apex Controller------- -----
public with sharing class CASReportController {
    @AuraEnabled
    public list<JSONWrapperController> wrapper {get;set;}

    public void deserialize() {

        try{
            string jsonresponse = '[{ "caPerformanceRecordList": [ { "motorDealerID": "XL1HX", "dealerName": "Subaru Auto Dealer", "reportingPeriod": "2019-05-18", "financeSourceIntegrationTypeCode": "FIFS", "idlPlus": "Y", "creditApplicationSourceCode": "STEONE", "submissionCount": 2 }, { "motorDealerID": "XL1HX", "dealerName": "Subaru Auto Dealer", "reportingPeriod": "2019-06-27", "financeSourceIntegrationTypeCode": "FIFS", "idlPlus": "Y", "creditApplicationSourceCode": "STEONE", "submissionCount": 5 } ], "ecPerformanceRecordList": [ { "motorDealerID": "XL1HX", "submitUserID": "BCUSER1", "bookedDate": "2019-05-22 00:00:00.0", "ecEligible": "Y", "caBookedCount": 1, "ecBookedCount": 0 }, { "motorDealerID": "XL1HX", "submitUserID": "BCUSER1", "bookedDate": "2019-06-05 00:00:00.0", "ecEligible": "Y", "caBookedCount": 1, "ecBookedCount": 0 } ] }]';

            system.debug('json string is ' +jsonresponse);
            wrapper = (list<JSONWrapperController>) JSON.deserialize(jsonresponse, list<JSONWrapperController>.class);

            system.debug('This is the wrapper class: ' +wrapper);
        } catch (Exception e){
            system.debug('Error---->' +  e.getLineNumber() + e.getMessage());

        }
    }


public class JSONWrapperController {

public List < CaPerformanceRecordList > caPerformanceRecordList{
get;set;
}
public List < EcPerformanceRecordList > ecPerformanceRecordList{
get;set;
}
}
public class EcPerformanceRecordList {
public String motorDealerID{get;set;}
public String submitUserID{get;set;}
public String bookedDate{get;set;}
public String ecEligible{get;set;}
public Integer caBookedCount{get;set;}
public Integer ecBookedCount{get;set;}
}



public class CaPerformanceRecordList {
public String motorDealerID{get;set;}
public String dealerName{get;set;}
public String reportingPeriod{get;set;}
public String financeSourceIntegrationTypeCode{get;set;}
public String idlPlus{get;set;}
public String creditApplicationSourceCode{get;set;}
    public Integer submissionCount{get;set;}

}

}


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.
This was selected as the best answer
RarLopzRarLopz
Thank you @DeepaliKulshrestha and @AlainCabon 

Deepali, Truly appreciate your help. I promise to pay it forward.