function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
DrBix65DrBix65 

Remote Action that Returns a List of Objects with a Master Detail Relationship

I have an odd problem with a utility class.  Assume I have two objects, Object1 and Object2 that have a Master-Detail relationship.  I have two methods that look like this:

 

@RemoteAction

public static List<Object1__c> getList () {

  return [

    Select

      Id,

      Name,

     (Select Id, Name from Object2__r)

    From

      Object1__c

    Where Id = :someId

  ];

}

 

@RemoteAction

public static void saveList (List<Object1__c> objList) {

  // Update the list

}

 

Both methods work perfectly using Javascript remoting.  However, when there are actually CHILD objects in the query, the save fails with (pretty much) no useful information.  Is there some bug, or "gotcha" that I'm not aware of that affects remoting of objects that have a master-detail relationship?

 

Thanks in advance.

EnreecoEnreeco

Hi DrBix65,

have you found a solution to this problem?