You need to sign in to do that
Don't have an account?

Identity Field in a Query?
I am not sure how to get an identity field to work in a function in an apex class. I have:
public void UpdateSupportFields(ID OpportunityID, string SupportConsultant, string OppStatus ......[other fields])
Opportunity[] op=[SELECT ID, Support_Consultant__c, ...., Support_EXT_Name_Test__c, Support_Network__c, Support_Last_Update_Live__c, Support_Last_Update_Test__c from Opportunity Where ID= :OpportunityID LIMIT 1];
//this next part is always 0 even if I have a valid Opportunity.ID
System.debug('Opsize: ' + op.size());
if (op.size() > 0)
When I use a test method on this, I have the following:
id MyID = '0068000000OyuwjAAB';
mySupportUpdate.UpdateSupportFields(myID, 'Mr. SupportConsultant', 'Cancelled', MyDate , MyDate , MyDate , .....) ;
Can I have an ID field like the above or is there something else the matter? I just want to be able to have the selection be for the Opportunity ID I pass into the function. Thanks! I just can't get rows when testing.


