You need to sign in to do that
Don't have an account?
DIVYANSHU BHUSHAN
Error while retrieving list fields
I am querying some fields from an object and saving this into a list. Now I want use one of the field in IF condition, but I am receiving error " Initial term of field expression must be a concrete SObject" at IF condition line.
Please help me with these guys.
Thanks in advance. :)
Please help me with these guys.
Thanks in advance. :)
Cid = ApexPages.CurrentPage().getparameters().get('id'); list<Client_Intake_Forms__c> conCount = new list<Client_Intake_Forms__c>(); conCount=[select id,name,Completed__c from Client_Intake_Forms__c where Client__c =:Cid ]; System.debug('conCount>>>>>>>>>>'+conCount); if(conCount.Completed__c == true ){ ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'This client has a finished intake form. A new intake form cannot be started.')); System.debug('In error condition'); }
kevin lam
conCount is a list and therefore you're getting an error in referencing conCount.Completed__c. You either need to reference a particular element of conCount or do it in a loop.
Chandra Sekhar CH N V
do something like this: