I have a Master Object A...
...And a Child Object B with a Master-Detail field A__c pointing to A...
...I'm trying to create a B record, child of a pre-existent record A using Remote Objects...
...so I create my B record in Javascript and then call the .create() function...
var record = new MYNS.B({Name: 'blabla', A__c: 'a08U000000jFvPR'});
record.create(...);
...but my record is not created because VF Remoting complains that the field A__c (the Master-Detail field) is not writeable even if I'm creating and not updating the record...
...I suppose that's because under the hood the Salesforce Remote Object standard Controller class is using Dynamic Apex and SObject.put() to fill/create the SObject on the Apex side, and that exactly wouldn't work to handle the case - we'd need to use the specific SObject constructor to fill our field:
B__c record = new B__c(Name = 'Blabla', A__c = 'a08U000000jFvPR');
...I guess if I was to set the Master-detail as reparentable the error would disappear, but that's not what I want...
...so am I missing something, or what can I do to overcome this problematic Remote Objects behavior with Master-Detail fields without recurring to a Remote Action Override?