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
Varun AnnadataVarun Annadata 

How to get a number from a sobject list?

Program_Member_Stage_MVN__c stagesequence = [select Stage_Number__c from Program_Member_Stage_MVN__c where id=:PId];

how to i get Stage_Number__c from the above list to assign it to where clause in the below soql query ==here(Stage_Number__c<????)

        List<Program_Member_Stage_MVN__c> Pstages=new List<Program_Member_Stage_MVN__c>([select id,Stage_Number__c,Parent_Stage__c,Status_MVN__c,Parent_Program_Member_Stage_MVN__c from Program_Member_Stage_MVN__c where Program_Member_MVN__c=:Pm.id and Parent_Stage__c='Parent_Stage_MVN' and Parent_Program_Member_Stage_MVN__c!=:PId and Stage_Number__c<????]);
 
Best Answer chosen by Varun Annadata
VamsiVamsi
Hi,

Please try the below and hoping the data type of stage number is a integer or please modify as required.

Integer stagesequence = [select Stage_Number__c from Program_Member_Stage_MVN__c where id=:PId].Stage_Number__c ;

Please mark as best answer if the above helps...!!!

All Answers

VamsiVamsi
Hi,

Please try the below and hoping the data type of stage number is a integer or please modify as required.

Integer stagesequence = [select Stage_Number__c from Program_Member_Stage_MVN__c where id=:PId].Stage_Number__c ;

Please mark as best answer if the above helps...!!!
This was selected as the best answer
Varun AnnadataVarun Annadata
Thank you
VamsiVamsi
Please mark as best answer, If the above solution works. So that we can keep the forum clean.. Thanks ..!! Virus-free. www.avast.com