You need to sign in to do that
Don't have an account?
Varun99
field tracking in vf page
Hi,
How to query on field history object in vf page? i have an object Product_table__c enabled for field tracking for one field
and am getting record id how to know history object API name?
Any one help me
Thank you
Select OldValue, NewValue, FieldName from Product_table__History where ParentId =: Id and FieldName = fieldAPIName
All Answers
Select OldValue, NewValue, FieldName from Product_table__History where ParentId =: Id and FieldName = fieldAPIName
Hi,
Thank you for your reply. Exactly what am i expect it is correct solution. But am facing one more problem Shall i pagination on history records am using standard set controller am getting this visualforce error
"List controllers are not supported for Product_Table__History"
my standard set controller
public ApexPages.StandardSetController fiopagnation
{
get {
if(fiopagnation== null) {
fiopagnation= new ApexPages.StandardSetController(Database.getQueryLocator([Select ID,createddate,parentid,CreatedById,CreatedBy.Name,Field, OldValue, NewValue from Product_Table__History where parentid=:productid ORDER BY CreatedDate DESC]));
// sets the number of records in each page set
fiopagnation.setPageSize(20);
}
return fiopagnation;
}
set;
}
public list<Product_Table__History> categories=new list<Product_Table__History>();
public List<Product_Table__History> getCategories()
{
categories = new List<Product_Table__History>();
for (Product_Table__History category : (List<Product_Table__History>)fiopagnation.getRecords())
categories.add(category);
return categories;
}
Is it possible to set pagination for history object adding wraper class?
Thank you
Hi subbu,
Thanks for your reply. Am enabled field history track for my cost field and get in my visual force page through apex soql.
can we query in visualforce page ? is this best practise?