1

We have a custom Lightning Component which pulls back the IsClosed field from an Apex Controller for a Customer Community Plus user. We are selecting the record via SOQL and returning back to the Lightning Component but when we try to access it, the value is undefined:

// x is undefined
var x = caseRec.isClosed;

Checking user profiles, there doesn't appear to be a way to set access to this field.

Is there any way to expose this field to a Customer Community Plus user, or a work-around if not?

  • That is it! Thank you. Please post as answer so I can accept. – Swisher Sweet Apr 4 '19 at 19:41
0

Based on my observations, if you return field values from SOQL from an Apex method, the first letter of the field names are always serialized in UPPERCASE. So in your case, using it as caseRec.IsClosed should work.

So if you have a SOQL written in apex as say:

@AuraEnabled
public static List<Case> getMyCases() {

    return [SELECT isClosed FROM CASE];
}

To access the field value in JS or Component, you will always want to use the field value as IsClosed.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.