• Rebecca Hendricks 42
  • NEWBIE
  • 0 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 2
    Replies
I am trying to use a SOQL query in an Apex Class to try and get the Record Type Id of the Case that is passed to the method.  Here is the Code I have so far:
/* Get the Record Id of the Case Provided */
    @AuraEnabled
    public static String getRecordTypeId(Case caseProvided){
         List<RecordType> recordTypeNames; 
        recordTypeNames = 
            [SELECT RecordTypeId FROM Case WHERE Id = :caseProvided.Id LIMIT 1];
        return String.valueOf(recordtypeNames.get(0));
    }
However, when I try and save my code, I get an "Illegal assignment from List to List" error.  I believe this is due to my SOQL statement returning a data type differant than the datatype of my list.  However, when I look in Object Manager at the Case Object, the RecordTypeId is listed as being of type RecordType.

Am I missing what is wrong with this code?
 
I am trying to use a SOQL query in an Apex Class to try and get the Record Type Id of the Case that is passed to the method.  Here is the Code I have so far:
/* Get the Record Id of the Case Provided */
    @AuraEnabled
    public static String getRecordTypeId(Case caseProvided){
         List<RecordType> recordTypeNames; 
        recordTypeNames = 
            [SELECT RecordTypeId FROM Case WHERE Id = :caseProvided.Id LIMIT 1];
        return String.valueOf(recordtypeNames.get(0));
    }
However, when I try and save my code, I get an "Illegal assignment from List to List" error.  I believe this is due to my SOQL statement returning a data type differant than the datatype of my list.  However, when I look in Object Manager at the Case Object, the RecordTypeId is listed as being of type RecordType.

Am I missing what is wrong with this code?