0

In one of my methods, I'm getting an internal server error, when I'm trying to access one field value.

I guess it's because of the way I'm trying to access the field.

@AuraEnabled
public static string createABAData(List<ABA_Data__c> abaPDataList,string parentId){
        for(ABA_Data__c abaProgram : abaPDataList){
            Boolean isFirst = true;
            system.debug('>>> function... '+abaProgram);
            //system.debug('>>> function type... '+abaProgram.Notes__c); // getting error while trying to access notes field
}

This is the value I'm receiving in the first debug logs

ABA_Data__c:{Notes__c=[value 1, value2], Date_Recorded__c=2021-02-08 00:00:00}

What's the reason I'm getting this error when I'm trying to access the field value?

the parameters to this method is passed from Aura Component

1 Answer 1

1
ABA_Data__c:{Notes__c=[value 1, value2], Date_Recorded__c=2021-02-08 00:00:00}
                      ^-? bad value ?-^

You need to convert this value to the appropriate data type for Notes__c, probably a String. This should be reported as a bug to Salesforce, but in the interim, fixing the data to the correct type before calling the method should fix the problem.

3
  • this is of multi select picklist type
    – sfdc
    Commented Feb 7, 2021 at 16:56
  • @sfdc Do the values you're passing in match the API names of the select list?
    – sfdcfox
    Commented Feb 7, 2021 at 17:58
  • Yes it matches with the API names, I'm able to access other fields. I guess it's because of the format of multi-select picklist which you already highlighted. This picklist field gets value from duallistbox
    – sfdc
    Commented Feb 7, 2021 at 19:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .