0

Locker service sobject as parameter

While passing an object of sobjectType Quote to an apex controller from lightning helper, we are facing an error "Unable to read SObject", but same thing is working fine without locker service turned on. following are lines of codes for the same..

quote.sobjectType = 'Quote';      
var action = component.get('c.saveQuote');

        action.setParams({
            v_quote: quote
            lineItems: lineItems
        });
$A.enqueueAction(action);

controller:

public static Quote saveQuote(Quote v_quote, List<QuoteLineItem> lineItems) {
    system.debug(v_quote);
    ///logic
    update v_quote;
    ///logic
    return v_quote;
}
2
1

As @Eric mentioned, there is a lot of info already on this site about the issue you are running into. The short of it is that you are probably hitting this guy: https://success.salesforce.com/issues_view?id=a1p3A0000001BoBQAU&title=lockerservice-new-properties-added-to-an-object-in-javascript-are-not-visible. This is supposedly getting fixed in Summer '17 but as far as I can tell nobody has been able to test and confirm that.

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.