I have two remote actions. One returns the result set of an Account query. That Account query has a subquery for Assets, so for all intents and purposes, the query is [Select Id, (Select Id From Assets) From Account];
. Any given Account in the result set from that query will look like {Id: "003450345k", Assets: Array(2)}
or something like that in JSON.
The second remote action has a method signature of @RemoteAction public static void save(Account account) { ... }
. When this remote action is invoked in JavaScript, it fails and reports a "Visualforce Remoting Exception: No such column 'Assets' on sobject of type Account"
Does anyone know of a way that you can do this? It would be really nice to be able to pass the child relationship collections of sObjects back to the server so that I don't need to re-query for them and do something like let {Assets, ...record} = account;
and then invoke save(record);
with the remainder account that effectively now has had Assets stripped out of it.
Both VF page and controller extension are api version 40.0