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
Phuc 2Phuc 2 

Get all record fields from record id

Hello,
How do you go about getting all of the fields(and value) when you only have the record Id for the object? 

Thank
P
PriyaPriya (Salesforce Developers) 
Hey,

Can you elaborate this requirement?

Thanks!
Phuc 2Phuc 2
Hello Priya,
So if a method is passed an Id value but I need to retrieve other fields from the record.  Do I have to query them all or is there a function I can use?  The fields needed may not always be the same that is why I was wondering if there was a way to dynamically retrieve them.
Thanks
P