Can anyone help clarify how to obtain a field in my salesforce DB as a string (say for example Name from a specific/single Account) where I am searching by lets say custom_ID__c in Accounts? I am familiar with most sql and quering DBs but I cannot seem to get my queries to run and return one specific account record's Name. Here is what I have tried and failed with:
SObject s = [SELECT Name FROM Account WHERE Customer_Number__c = :ApexPages.currentPage().getParameters().get('ARID') LIMIT 1];
SObject s = [SELECT Name FROM Account WHERE Customer_Number__c = :ApexPages.currentPage().getParameters().get('ARID')];
SObject s = [SELECT Name FROM Account WHERE Customer_Number__c = :ARID LIMIT 1][0];
SObject s = Database.query('SELECT Name FROM Account WHERE Customer_Number__c = :ARID LIMIT 1');
Account act = new Account( = [Select Name FROM Account WHERE Customer_Number__c = :ARID LIMIT 1]);
I have tried each of these queries individually and most of them seem to compile but fail at runtime with no real error. :( please help
Thank you very much in advance