<?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>sObject &#8211; Hamza Siddiqui</title>
	<atom:link href="https://www.mhamzas.com/blog/tag/sobject/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>Fri, 13 Dec 2019 07:26:52 +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>Upserts with Generic sObjects &#8211; Salesforce</title>
		<link>https://www.mhamzas.com/blog/2019/12/13/upserts-with-generic-sobjects-salesforce/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=upserts-with-generic-sobjects-salesforce</link>
					<comments>https://www.mhamzas.com/blog/2019/12/13/upserts-with-generic-sobjects-salesforce/#respond</comments>
		
		<dc:creator><![CDATA[hamza]]></dc:creator>
		<pubDate>Fri, 13 Dec 2019 07:24:47 +0000</pubDate>
				<category><![CDATA[Salesforce]]></category>
		<category><![CDATA[apex]]></category>
		<category><![CDATA[salesforce]]></category>
		<category><![CDATA[sfdc]]></category>
		<category><![CDATA[sObject]]></category>
		<category><![CDATA[upsert]]></category>
		<guid isPermaLink="false">https://www.mhamzas.com/?p=3038</guid>

					<description><![CDATA[Have you ever run into this error? “Upsert with a field specification requires a concrete SObject type” Basically it is saying that you cannot declare a list of type sObject and then try to use the upsert command against that list. That <br /><a href="https://www.mhamzas.com/blog/2019/12/13/upserts-with-generic-sobjects-salesforce/" class="more-link btn btn-primary">Read More</a>]]></description>
										<content:encoded><![CDATA[
<p>Have you ever run into this error? “Upsert with a field specification requires a concrete SObject type”</p>



<p>Basically it is saying that you cannot declare a list of type sObject and then try to use the upsert command against that list. That limitation can make coding generic routines difficult which do not know the specific object type up front. For example, I might be building a table driven integration layer where the user will determine, by updating a custom field or custom setting, what the name of the destination custom object will be. With this approach I will need to use the generic sObject data type, but that will stop me from using the upsert database command.</p>



<p>Bummer! What to do?</p>



<p>Here is a&nbsp;<a href="http://salesforce.stackexchange.com/questions/61340/is-it-possible-to-upsert-a-listsobject-with-external-id-specified">link</a>&nbsp;that describes this problem very clearly and jangiz at the bottom describes the correct work-around approach.</p>



<p>Here is some code to implement that work-around that jangiz described:</p>



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



<p>Wow, what a bunch of work when I really just wanted to write…<br>upsert sObjList myExternalIDField</p>



<p>But as long as there is a manageable work-around I can at least move forward!</p>



<p>Good luck with your Apex today!</p>



<p>Source :  <a href="https://www.sundoginteractive.com/blog/generic-sobjects-salesforce">https://www.sundoginteractive.com/blog/generic-sobjects-salesforce</a> </p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.mhamzas.com/blog/2019/12/13/upserts-with-generic-sobjects-salesforce/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">3038</post-id>	</item>
	</channel>
</rss>
