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
DevelopementDevelopement 

Account History Related List Issue

Hi,

We have Visual force Page for Accounts. We have also created a history related list on it. 
<apex:pageBlock title=" History" id="Account_History">
      <apex:pageBlockTable value="{!acchistlist}" var="accounthistory" rows="1000">
         <apex:column value="{!accounthistory.createddate}"/>
         <apex:column value="{!accounthistory.createdby.name}"/>
         <apex:column value="{!accountHistory.field}"/>
         <apex:column value="{!accounthistory.oldvalue}"/>
         <apex:column value="{!accounthistory.newvalue}"/>
      </apex:pageBlockTable>

This is the query
SELECT CreatedById,CreatedDate,CreatedBy.name,Field,NewValue,OldValue FROM AccountHistory

but when I update Account owner, I get 2 rows--> 1 with user id and other with user name
User-added image

How can I get rid of 2nd row i.e. I dont want to see ID row on the history.

Thanks so much for help!


 
Kyle BrandtKyle Brandt
May I ask why this has to be a VF page and why you dont use the report on AccountHistory?
DevelopementDevelopement
This is obviously easy for our users to see the tracking on the account. They just need to scroll down to the page and view the tracking.
Kyle BrandtKyle Brandt
If you run your query in Force Explorer https://developer.salesforce.com/page/ForceExplorer do you see the same results? I ran this in my org and don't receive the second line with ID. Might need to see your controller for this.
DevelopementDevelopement
Yeah you are right. I do get only 1 row when i run this query separately. I will check the controller.