Contents
Is there an illegal assignment from a list?
You are assigning List of SurveySelections__r into String ( SurveySelection ). So please convert the SurveySelection into List. Hope this helps, let me know if you still face the issue. Thanks for your help. Greatly appreciated. I tried the code you provided me. I am getting “Invalid type: SurveySelections__c at line 6..”
What’s the problem with assignment from list to list?
The problem was that when I would check my debug log, it wasn’t saving the Referral_ID__c value, which is why I was trying to change it to a string instead. Any ideas where I’m going wrong? You should be able to iterate the list and add the field to a separate collection: I’d like to post this as a comment, but I think it became too big for it.
What is the data type for surveyselection in apex?
I am trying to find how to go about resolving this error. I am new to Apex. By the way, the data type for “SurveySelection__c” is Number (2,0).
How to debug sobject’s record results in apex?
If you directly debug your record results: the debug log will only display your sObject’s own fields, not the ones that come from relationships (Contact.Referral_ID__c), but that doesn’t mean that such field was not retrieved inside your records results, therefore if you do something like: then you’ll see the value that you’re looking for.
Is there an illegal assignment from list in apex?
I am new to Apex. By the way, the data type for “SurveySelection__c” is Number (2,0). I am not sure whether that matters. Thanks in advance! You are assigning List of SurveySelections__r into String ( SurveySelection ). So please convert the SurveySelection into List. Hope this helps, let me know if you still face the issue. Thanks for your help.
Can you assign a field to a string?
You cannot assign it to a list of String. Whenever you need field value from any object you need SOQL. Try the below code.
Why is apex showing an error like ” illegal assignment from integer to string?
Why is it showing an error like “Illegal assignment from Integer to String” ? Make sure that destination field type is same as that of the value you are trying to put into it. If MC_LineNumber__c is of type string then use
How to assign an integer to a string?
Make sure that destination field type is same as that of the value you are trying to put into it. If MC_LineNumber__c is of type string then use Or else, specify return type of method getLineNumber () same as that of MC_LineNumber__c.