Skip to content

Mock sub select query (addQueryFactorySubselect to ChildAccounts) #418

Answered by stohn777
lukethacoder asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @lukethacoder,

I believe the serialization route is the better path to pursue. However, pull a native Account list having child Accounts from Salesforce, serialize and inspect. The ChildAccounts JSON property has some extra information to synthesize, including "totalSize", "done" and "records". The latter containing the serialized, children list.

Here's a fairly simple, native serialization that I pulled:

[ {
  "attributes" : {
    "type" : "Account",
    "url" : "/services/data/v55.0/sobjects/Account/0012200000bJ0myAAC"
  },
  "Id" : "0012200000bJ0myAAC",
  "Name" : "Acme",
  "ChildAccounts" : {
    "totalSize" : 2,
    "done" : true,
    "records" : [ {
      "attributes" : {
       …

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@lukethacoder
Comment options

Answer selected by lukethacoder
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants