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
Starz26Starz26 

Get Record without SOQL using sObject

After I insert a record I would like to have access to the value of an AutoNumber field.

 

I see to recall a way to load / get a record based on an sObject but cannot locate it (Or I am crazy).

 

I would like to not have to do an SOQL statement if at all possible. One would think there would be a way to do it. All attemps to reference the field after inserting the sObject return null since it was not part of the sObject statement I inserted and since I cannot set the value, I cannot add the field in the statement.

sushant sussushant sus
without query you can use standard controller with recordset in page

then you can show all record without query
Starz26Starz26

sushant sus wrote:
without query you can use standard controller with recordset in page

then you can show all record without query

Thanks, but not speaking of a Visualforce controller or extension

Venkat PolisettiVenkat Polisetti

No. There is no way except to use SOQL.

 

If you find a way out, please let me know (that way you can prove your are not crazy!).

 

This is one of the beefs that I have with Apex. After I insert a record through an sobject, I would like to have SF set at least  autonumbers,  formula fields and other fields such as name on a Contact ( a concat of first and last names).

 

Thanks,

Venkat