0:06
hello everyone in this video we are
0:09
going to see how to fetch or get child
0:13
objects of a parent object in Salesforce
0:21
Apex first I'm using schema. describe a
0:26
result I am declaring a variable called
0:28
obj result equal to account. S object
0:32
type. describe so first I'm going to get
0:36
the S object result for account
0:41
next I'm declaring list schema. child
0:47
relationship for that I'm declaring a
0:49
variable called obj relationships equal
0:52
to the ob the describe a subject result
0:55
dot get child relationships so this
0:59
method will return all the child objects
1:05
object since it's a list I'm iterating
1:08
using for Loop and then
1:12
using get relationship name method I
1:16
am using a system. debug statement to
1:19
print it let's run this and then see the
1:41
object if you wanted to query the
1:44
records then we can make use of sub
1:46
subquery for example here I'm getting
1:49
the name of the account along with that
1:53
I'm also getting the name and account ID
1:56
from the contact object contact as child
2:00
so using subquery we can get the child
2:10
records please check the video
2:13
description in the video description I
2:15
have shared my block post from the Block
2:17
post you should be able to get the
2:19
sample Apex code and the S soql which
2:22
were referenced in this
2:38
helpful thank you for