Filter out 'Ids' from Field History models?

When changing a lookup field in Salesforce, 2 instances of FieldHistory objects are created, one that has the Salesforce ID in the Old/New value field, and the other that has the Name of the lookup object that was changed in the Old/New value field.

Is there any way in SKUID to filter out the instances where a Salesforce ID is in the Old/New value field on FieldHistory objects?

Doing a search online finds a way to do this in APEX, basically identifying if the field is an instance of a Salesforce ID but we can't utilize these tools in SKUID (or is there a way to do that with javascript perhaps?).

List<AccountHistory> ach = [SELECT Id, Account.Name, Field, OldValue, NewValue 
                            FROM AccountHistory 
                            WHERE Field = 'Owner' 
                            ORDER BY CreatedDate DESC];
List<AccountHistory> targetAch = new List<AccountHistory>();
for(AccountHistory ah : ach)
    if(!(ah.NewValue instanceof Id))

How might we be able to go about filtering out these fieldHistory rows that show Salesforce IDs in SKUID?



Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!