Page 1 of 1

Tracking ClientContact changes

Posted: Fri Jan 25, 2019 11:32 am
by ivandevpartner
Hello,
I would like to know if there is any entity that holds the history of changes done do ClientContacts, specifically the "status" field.
Some entities support {Entity}EditHistory and {Entity}EditHistoryFieldChange tables to track field changes, but it looks like ClientContact is not one of them.

Is there any was to get the values of the "status" field and the date that those were applied?

Re: Tracking ClientContact changes

Posted: Tue Jan 29, 2019 3:15 pm
by KevinSupport
Hi Ivan,

ClientContact edit history is available in the {Entity}EditHistory and {Entity}EditHistoryFieldChange tables under the User entity. User comprises all "people" entities so you would want to use the UserEditHistory entity if pulling edit history for ClientContact, Candidate, CorporateUser, or Lead records.

Re: Tracking ClientContact changes

Posted: Wed Jan 30, 2019 11:30 am
by ivandevpartner
Thanks for the info.
I have hit a small problem with pulling changes for ClientContacts specifically.
The following request gives me an error on my targetEntity filter:

Code: Select all

query/UserEditHistory?where=(dateAdded>=946677600000)AND(dateAdded<=1577829600000)AND(targetEntity._subtype=ClientContact)&fields=targetEntity,dateAdded,id&sort=id&count=500&start=0
The error:

Code: Select all

    "errorMessage": "Where clause 'subtype' at position 73 is not a valid field name.",
    "errorCode": 400
I am sure that there is a field called "_subtype" in the targetEntity object.
Is the request semantically wrong, or is the approach completely wrong?

Re: Tracking ClientContact changes

Posted: Mon Feb 11, 2019 4:13 pm
by KevinSupport
Hi Ivan,

You cannot search or filter off the subtype field. Instead I would recommend getting your desired list of Contacts first through a query against the ClientContact entity then putting those IDs into a UserEditHistory query.

/query/UserEditHistory?where=targetEntity.id IN ([comma separated list of IDs])&BhRestToken=4f868c1b-81ba-4b65-9326-404119d57bf9&fields=*

Re: Tracking ClientContact changes

Posted: Tue Feb 12, 2019 10:23 am
by jcolton
Hello Ivan,

This is Joseph from the Bullhorn Support team.

As stated previously, you cannot filter off of the _subtype field. Running some tests on this, however, it appears that you can filter off of the personSubtype field which should match the _subtype. Try the following:

Code: Select all

query/UserEditHistory?where=(dateAdded>=946677600000)AND(dateAdded<=1577829600000)AND(targetEntity.personSubtype='ClientContact')&fields=targetEntity,dateAdded,id&sort=id&count=500&start=0