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
ZombiePrawnZombiePrawn 

Querying Duplicate Records: Tagging which had the most and least values in fields.

Good Day,

What im trying to do is to identify the matched records and provide a new column that will serve as a tag which record has the most populated values.
Here is sample records
---------------------------------------------------------------
Id,   Name            Field1      Field2     Field3      Field4
xxx1  TestName1       aaaaaa                             cccccc
xxx2  TestName1                   bbbbbb
xxx3  TestName1       xxxxxx                 yyyyyy   
xxx4  TestName1       test        test       test


is it possible that once i collected the fields using getdescribe, i'll be able use this when looping records?
 

thanks in advance!,
mj
 

Best Answer chosen by ZombiePrawn
logontokartiklogontokartik
Yes you can use the describe to get the fields and get the values using dynamic reference in Visualforce or SObject.get() in Apex and get the values

Thank you

All Answers

logontokartiklogontokartik
Yes you can use the describe to get the fields and get the values using dynamic reference in Visualforce or SObject.get() in Apex and get the values

Thank you
This was selected as the best answer
ZombiePrawnZombiePrawn
Thank you logontokartik!

Damn.. imagine if i were to loop thousands of record and check which record contains the most values to the fields. i guess i need to move this code in the batch process..