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
Pok LauPok Lau 

Unable to select a single Auto Numbers frm the object

This is my table Demo : these are my  fields
auto _Id (Auto number and unique ) 
Version : string (ex 8.3.1, 8.3.3)

 The user selects a version from the drpdown say 8.3.1. Now I want to retrieve the corresponding auto_id in the controller, which is not a list but just a number. How can I query this?

Please Help..
Vishal_GuptaVishal_Gupta
Hi, 

You can do query like :

Integer autoId = [Select auto_Id,Version from Demo where Version ='8.3.1' Limit 1].auto_Id;

Thanks,
Vishal