Field History Table Entry(Row) Displays USER ID instead a full name - How to hide these rows. Please help

  • 1
  • Question
  • Updated 3 years ago
  • Answered
I have a table which display the history of a custom object.
Whenever I change a USER look up filed on object it creates two rows for history

like below snap shot

How to HIDE - that row with USER-ID showing in New Value/Old Value ?
Photo of KVin

KVin

  • 1,158 Points 1k badge 2x thumb

Posted 3 years ago

  • 1
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb
Set a Condition on the Model for the field "Field" to Not Equal the "User".

Photo of KVin

KVin

  • 1,158 Points 1k badge 2x thumb
If you closely observe that image I have attached
It has 2-rows for the same field USER, which is a look-up for USER Object.
Whenever we change a look up field, theere will be 2 rows created on history object which is a standard feature.

Now My requirement is to not to show those rows which have VALUE displayed as ID(18 Digit)- which is confusing for the user to refer.
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb
I see. There is documentation on this from this page.
https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_entityhistory.htm


  • Two rows are added to this object when foreign key fields change. One row contains the foreign key object names that display in the online application. For example, “Jane Doe” is recorded as the name of a contact. The other row contains the actual foreign key ID that is only returned to and visible from the API.

You can run a snippet that could remove these rows from the model.
Photo of KVin

KVin

  • 1,158 Points 1k badge 2x thumb
Hey Pat,
Thanks for the clear guidelines.

rather than removing/deleting from model, is there any way to hide rows using snippet ?
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb
Hi Venky,

The records wouldn't be removed. The rows would be removed, which is to say the client side model wouldn't have the records, which is to say the table wouldn't have the records. Basically, hiding the rows. There is a function called abandonRow() used to do this.

Pat
Photo of KVin

KVin

  • 1,158 Points 1k badge 2x thumb
Hey Pat,

Thanks for your response!

I found some other way to solve this :

Add conditions to render table fields in Table (should be added directly in XML as it's not available in UI to create)

<conditions>                       
<condition type="fieldvalue" value="005" operator="does not start with" field="NewValue"/>
<condition type="fieldvalue" value="005" operator="does not start with" field="OldValue"/>
<condition type="fieldvalue" value="Name" operator="does not start with" field="Field"/>
</conditions>

Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
Look at this forum post for a full explanation of showing history records effectively in Skuid:  https://community.skuidify.com/skuid/topics/display-field-history-for-the-case-object