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
zeezackisbackzeezackisback 

Case/Claim history not working

I am trying to modify the timeline api, but I am not having much success.

 

 

 

sforce.connection.query( "SELECT Id, OldValue, NewValue, IsDeleted, Field, CreatedDate, CreatedById FROM Claim__History"+ " where ParentId = '{!Claim__c.Id}' order by CreatedDate ", layoutCaseHist );

 

 

 

werewolfwerewolf
Are you sure the Claim__History table has a field called ParentId?  Did you use Firebug there to put a breakpoint there to see if that query is getting generated properly and whether it is returning an error?
zeezackisbackzeezackisback

Hey ya man,

Claim__History has a field called ParentId. It stores the actual claim id there.

 

I've been using eclipse to run the queries... it populates the claim id in parent id. but old value and new value are blank..

 

Claim__History
Id
IsDeleted
ParentId
CreatedById
CreatedDate
Field
OldValue
NewValue

 

 

 

Claim History

 
DateUserConnectionAction
03/06/2009 17:15 Brian
 Changed Claim Status from Sent Form to Passed File To Legal.
27/05/2009 18:21 Kia
 Changed Claim Status from Initial Audit Received to Sent Form.
08/04/2009 13:12 Brian
 Changed Claim Status from Sent for Initial Audit to Initial Audit Received.
01/04/2009 11:33 Kia
 Created.
 
 
No errors
 
its just when I run the query on claim history
 
FIELD only contains which field in Claims has been changed.
 
I am unsure how to pull out ALL the detailed information like above... I can run a join, but only pull out the claim status as it currently stands?
zeezackisbackzeezackisback

When I run the query it looks like this

 

- Now I would use Parent id to pull out the claim and find the status of that claim...but it won't report back the past Claim Status... so how the hell does it do it?

 

IdIsDeletedAscending
ParentId 
CreatedByIdCreatedDateFieldOldValueNewValue
0172000000q3gRnAAIFALSEa0C20000001miqEEAQ00520000000vFALAA222/01/2009 14:58created  
0172000001Dq0RwAAJFALSEa0C20000001miqEEAQ0052000000122zQAAQ15/06/2009 14:34Claim_Status__c  
0172000001DpnOOAAZFALSEa0C20000001miqEEAQ005200000012d3ZAAQ15/06/2009 13:23Claim_Status__c  
01720000016xrbqAAAFALSEa0C20000001miqEEAQ00520000000vFA1AAM12/05/2009 10:44Claim_Status__c  
01720000017ZjWPAA0FALSEa0C20000001miqEEAQ0052000000122zQAAQ16/05/2009 18:55Claim_Status__c  
01720000017ZjWuAAKFALSEa0C20000001miqEEAQ0052000000122zQAAQ16/05/2009 18:56Claim_Status__c  
zeezackisbackzeezackisback
In regards to the timeline api, I managed to get it working...but still need to know more on how this system works.
werewolfwerewolf
Under normal circumstances you'll see both an OldValue and a NewValue on a given history row (unless of course one or both were null, but it's usually not both, anyway).  What do you see when you look at other history tables?
zeezackisbackzeezackisback

I could try and mimick that...on a different table. My company are only interested in just the claims..

 

Salesforce sets it up automatically when you request history tracking.

werewolfwerewolf
No, I'm saying, check out the data on some other __history tables if you have any.  It's odd that you'd be getting nulls for Oldvalue and Newvalue.
zeezackisbackzeezackisback

Hey ya Werewolf, its the same with CaseHistory

 

It populates the table with null values for oldvalue and newvalue ?

werewolfwerewolf
You know, when I run a query on CaseHistory in the Force.com IDE I also see a bunch of nulls there, and when I click on the nulls an empty window shows up.  I suspect there's actually data in those fields but there's a bug in the Force.com IDE.