4

When you run the code below, everything works as expected. The console logs an object with all of the a-z properties minus r and s of course since they are commented out.

If you uncomment s, the console logs 118 - just the number, not in an object. When you uncomment r, the console logs undefined. There is no issue with using any of the upper-case letters.

Does anyone have any theories on why lower-case r and s would be causing this issue?

// Client-side controller

({
    handlePress : function(component, event, helper) {
        var action = component.get("c.returnClassic");
        action.setCallback(this,function(response){
                if (response.getState() === "SUCCESS"){
                    console.log(response.getReturnValue());
                }
            });
        $A.enqueueAction(action);
    }
})

// Server-side controller

public class LightningController {

    public class Classic{

        @AuraEnabled public Integer a {get; set;}
        @AuraEnabled public Integer b {get; set;}
        @AuraEnabled public Integer c {get; set;}
        @AuraEnabled public Integer d {get; set;}
        @AuraEnabled public Integer e {get; set;}
        @AuraEnabled public Integer f {get; set;}
        @AuraEnabled public Integer g {get; set;}
        @AuraEnabled public Integer h {get; set;}
        @AuraEnabled public Integer i {get; set;}
        @AuraEnabled public Integer j {get; set;}
        @AuraEnabled public Integer k {get; set;}
        @AuraEnabled public Integer l {get; set;}
        @AuraEnabled public Integer m {get; set;}
        @AuraEnabled public Integer n {get; set;}
        @AuraEnabled public Integer o {get; set;}
        @AuraEnabled public Integer p {get; set;}
        @AuraEnabled public Integer q {get; set;}
//        @AuraEnabled public Integer r {get; set;}
//        @AuraEnabled public Integer s {get; set;}
        @AuraEnabled public Integer t {get; set;}
        @AuraEnabled public Integer u {get; set;}
        @AuraEnabled public Integer v {get; set;}
        @AuraEnabled public Integer w {get; set;}
        @AuraEnabled public Integer x {get; set;}
        @AuraEnabled public Integer y {get; set;}
        @AuraEnabled public Integer z {get; set;}

        public Classic(){
            a = 97;
            b = 98;
            c = 99;
            d = 100;
            e = 101;
            f = 102;
            g = 103;
            h = 104;
            i = 105;
            j = 106;
            k = 107;
            l = 108;
            m = 109;
            n = 110;
            o = 111;
            p = 112;
            q = 113;
//            r = 114;
//            s = 115;
            t = 116;
            u = 117;
            v = 118;
            w = 119;
            x = 120;
            y = 121;
            z = 122;
        }

    }

    @AuraEnabled
    public static Classic returnClassic(){
        return new Classic();
    }

}
2
  • 2
    Talk about finding a platform bug in the haystack.......Curios as to how you ended up in this position. just a random use of r and s?
    – Eric
    Jul 25 '15 at 20:28
  • 1
    Yes, I originally had a String s, which seemed like a reasonable name at the time, but it threw me for a loop when it didn't work.
    – martin
    Jul 26 '15 at 5:13
4

When we serialize the response, we use s to indicate a unique serialize ID, and r as a reference to a serialized ID. This way when we parse the structure on the client, we can stitch it back together.

Thankfully this should be going away in the future, but for now you have this limitation.

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.