Hello and thank you for taking the time to read my question. I have a simple call to the recordType object that will have to results. The reason I have two results is because I need to verify of the opportunity has a certain type of record id and if so then I will create a serviceContract with a certain recordtypeID. Simple enough, however governor limits scare me right now. Here is the code below.
RecordType RecHyperStream = [SELECT name, Description, id, SobjectType, BusinessProcessId FROM RecordType WHERE (SobjectType='Opportunity' AND Description='HyperStream Services') OR (SobjectType='ServiceContract' AND Description='This is the record type assigned to HyperStream Agreement') ];
In order to differentiate the two do I need to do a for Loop?
for(integer i =0; i < RecHyperStream.size(); i++) if(RecHyperStream[i].SobjectType == 'Opportunity') //put in a variable for opp else //put in a variable for serviceContract
Or is there a cleaner and simpler way that does not require a for-loop?
THanks again for your time.