You need to sign in to do that
Don't have an account?

field history tracking visualforce
<apex:component controller="GenericHistoryComponentController">
<apex:attribute name="myObject" description="Object we wish to view the history of" type="SObject" required="true" assignTo="{!myObject}" />
<apex:attribute name="recordLimit" description="Number of lines of history to display" type="Integer" required="false" assignTo="{!recordLimit}" />
<apex:pageBlock title="{!objectLabel} History">
<apex:pageBlockTable value="{!ObjectHistory}" var="History" >
<apex:column headerValue="Date" value="{!History.thedate}"/>
<apex:column headerValue="User">
<apex:outputLink value="/{!History.userId}"> {!History.who} </apex:outputLink>
</apex:column>
<apex:column headerValue="Action"><apex:outputText escape="false" value="{!History.action}"/></apex:column>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:component>
its showing me this error:-<apex:page> is required and must be the outermost tag in the markup at line 1 column 1
how to solve this?
<apex:attribute name="myObject" description="Object we wish to view the history of" type="SObject" required="true" assignTo="{!myObject}" />
<apex:attribute name="recordLimit" description="Number of lines of history to display" type="Integer" required="false" assignTo="{!recordLimit}" />
<apex:pageBlock title="{!objectLabel} History">
<apex:pageBlockTable value="{!ObjectHistory}" var="History" >
<apex:column headerValue="Date" value="{!History.thedate}"/>
<apex:column headerValue="User">
<apex:outputLink value="/{!History.userId}"> {!History.who} </apex:outputLink>
</apex:column>
<apex:column headerValue="Action"><apex:outputText escape="false" value="{!History.action}"/></apex:column>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:component>
its showing me this error:-<apex:page> is required and must be the outermost tag in the markup at line 1 column 1
how to solve this?
Please follow this link: https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_comp_cust_elements_markup.htm
Create the component in visual force component section and access it from the visual force page. I hope this helps you.
Thanks.