<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>dynamic &#8211; Hamza Siddiqui</title>
	<atom:link href="https://www.mhamzas.com/blog/tag/dynamic/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.mhamzas.com</link>
	<description>4x Salesforce MVP &#124; 26x Certified &#124; Salesforce App &#38; System Architect</description>
	<lastBuildDate>Tue, 20 Dec 2022 12:31:11 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9</generator>
<site xmlns="com-wordpress:feed-additions:1">233526040</site>	<item>
		<title>Get all Parent and child objects related to the current object</title>
		<link>https://www.mhamzas.com/blog/2022/12/15/get-all-parent-and-child-objects-related-to-the-current-object/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=get-all-parent-and-child-objects-related-to-the-current-object</link>
					<comments>https://www.mhamzas.com/blog/2022/12/15/get-all-parent-and-child-objects-related-to-the-current-object/#respond</comments>
		
		<dc:creator><![CDATA[hamza]]></dc:creator>
		<pubDate>Thu, 15 Dec 2022 11:01:24 +0000</pubDate>
				<category><![CDATA[Salesforce]]></category>
		<category><![CDATA[apex]]></category>
		<category><![CDATA[dynamic]]></category>
		<category><![CDATA[platform]]></category>
		<guid isPermaLink="false">https://www.mhamzas.com/?p=3497</guid>

					<description><![CDATA[Many times you have to find the related objects either you do it the hardcode way or another. Here I am sharing an example of how you can dynamically get the Related either Parent or Child. The below examples are for the <br /><a href="https://www.mhamzas.com/blog/2022/12/15/get-all-parent-and-child-objects-related-to-the-current-object/" class="more-link btn btn-primary">Read More</a>]]></description>
										<content:encoded><![CDATA[
<p>Many times you have to find the related objects either you do it the hardcode way or another. Here I am sharing an example of how you can dynamically get the Related either Parent or Child.</p>



<p>The below examples are for the standard &#8220;Account&#8221; object. However, this will work for any other standard or custom object &#8211; don&#8217;t forget to add __c for the custom objects.</p>



<h2 class="wp-block-heading">Get All Parent objects.</h2>



<pre class="wp-block-code"><code>for(Schema.SobjectField strFld: Account.SobjectType.getDescribe().fields.getMap().Values())
{
    if(strFld.getDescribe().getType() == Schema.DisplayType.REFERENCE)
    {
        system.debug('==parent object='+strFld.getDescribe().getReferenceTo());
    } 
}
</code></pre>



<h2 class="wp-block-heading">Get All Child objects.</h2>



<pre class="wp-block-code"><code>Schema.DescribeSObjectResult R = Account.SObjectType.getDescribe();
for (Schema.ChildRelationship cr: R.getChildRelationships()) 
{
  system.debug('====child object==='+cr.getChildSObject());
}
</code></pre>



<h2 class="wp-block-heading">Getting Relationship Names</h2>



<pre class="wp-block-code"><code>Schema.DescribeSObjectResult R = Account.SObjectType.getDescribe();
for (Schema.ChildRelationship cr: R.getChildRelationships()) 
{
  system.debug('====child object relation Name==='+cr.getRelationshipName());
}
</code></pre>



<p>Source: https://salesforce.stackexchange.com/questions/117050/get-all-parent-and-child-objects-related-to-the-current-object<br>Credit: https://salesforce.stackexchange.com/users/18731/ratan-paul</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.mhamzas.com/blog/2022/12/15/get-all-parent-and-child-objects-related-to-the-current-object/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">3497</post-id>	</item>
		<item>
		<title>Get Object and Field Label value using API Names</title>
		<link>https://www.mhamzas.com/blog/2021/04/21/get-object-and-field-label-value-using-api-names/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=get-object-and-field-label-value-using-api-names</link>
					<comments>https://www.mhamzas.com/blog/2021/04/21/get-object-and-field-label-value-using-api-names/#respond</comments>
		
		<dc:creator><![CDATA[hamza]]></dc:creator>
		<pubDate>Wed, 21 Apr 2021 10:18:48 +0000</pubDate>
				<category><![CDATA[Salesforce]]></category>
		<category><![CDATA[apex]]></category>
		<category><![CDATA[dynamic]]></category>
		<guid isPermaLink="false">https://www.mhamzas.com/?p=3237</guid>

					<description><![CDATA[This is a very common use case where you have the API Name, but you need the Current Labels for your object, or field. Either its Custom or Standard. Typically, you know it already, but you need it when you&#8217;re writing your <br /><a href="https://www.mhamzas.com/blog/2021/04/21/get-object-and-field-label-value-using-api-names/" class="more-link btn btn-primary">Read More</a>]]></description>
										<content:encoded><![CDATA[
<p>This is a very common use case where you have the API Name, but you need the Current Labels for your object, or field. Either its Custom or Standard.</p>



<p>Typically, you know it already, but you need it when you&#8217;re writing your apex dynamically.</p>



<p>Here is a simple method which accept API Names in STRING and returns the labels. You can modify as per your need:</p>



<script src="https://gist.github.com/mhamzas/98555fcde33fd6ee7d4559f31768b33b.js"></script>



<p>Happy Coding!</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.mhamzas.com/blog/2021/04/21/get-object-and-field-label-value-using-api-names/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">3237</post-id>	</item>
	</channel>
</rss>
