0

I am trying to display data that is being return by an API. On my system.debug I can see the data is there but on displaying on the page it only shows an array of the ids of the list object. This is the code to show it.

display.page

<apex:datatable value="{!dataArray}" var="data" styleclass="data-tbl" columnswidth="44%, 40%, 16%" headerclass="tbl--cell-header" rowclasses="odd,even">
 <apex:column >
        <apex:outputtext value="{!data}" />
 </apex:column>
 <apex:column >
        <apex:outputtext value="{!data.name}"  />
 </apex:column>
 <apex:column >
       <apex:outputtext value="{!data.title} : {!data.company}" />
 </apex:column>
 </apex:datatable>

Apex

public List<Data_Mapping__c> dataarray;

    public List<Data_Mapping__c> getdataarray() {

           // API call to get data
            dataArray = datafunctions.getData();

           // Shows actual data including id, name, title, column
            system.debug('@@@dataArray ' + dataarray);

            return dataarray;
        }

When I use system.debug('@@@dataArray ' + dataarray); it shows the output I want to use on page for example something like "{Data_Mapping__c: {Id: 123456abc, name: test, title: test-title, company: test-company}}" is on the user_debug log.

When I display dataArray on page it just shows [123456abd].

  • I think here you are facing issue due to FLS. Please check that logged-in user has access to the fields on Data_Mapping__c object. Check out this link to set FLS permission in Permission Sets and Profiles (developer.salesforce.com/docs/…) – Pragati Jain Oct 31 '18 at 16:54
  • I was able to do the able and my issue was solved. Thank you @PragatiJain – Dan C Oct 31 '18 at 17:26
  • I didn't get your mean. – Pragati Jain Oct 31 '18 at 17:46
0

apex:pageBlockTable and apex:dataTable require that any output be placed inside an apex:column.

<apex:datatable value="{!dataArray}" var="data" styleclass="data-tbl" columnswidth="44%, 40%, 16%" headerclass="tbl--cell-header" rowclasses="odd,even">
        <apex:column value="{!data}" />
        <apex:column value="{!data.name}"  />
       <apex:column value="{!data.title} : {!data.company}" />
 </apex:datatable>
  • I updated the code. The issue is i am getting data on my getdataarray() however. It is not transferring to page. – Dan C Oct 31 '18 at 16:29
0

I think here you are facing issue due to FLS. Please check that logged-in user has access to the fields on Data_Mapping__c object. Check out this link to set FLS permission in Permission Sets and Profiles (https://developer.salesforce.com/docs/atlas.en-us.securityImplGuide.meta/securityImplGuide/users_profiles_fls.htm)

  • This does not provide an answer to the question. You may like to post this as a comment and verify with the OP. And once confirmed by the OP, you can then roll this up as an answer with details. – Jayant Das Oct 31 '18 at 16:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.