<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Use Workflows to Audit Deleted Records</title>
	<atom:link href="http://www.dynamicscrmtrickbag.com/2009/05/14/delete_audit/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dynamicscrmtrickbag.com/2009/05/14/delete_audit/</link>
	<description>Building business value on Dynamics CRM</description>
	<lastBuildDate>Fri, 27 Jan 2012 13:09:05 -0800</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Ralph</title>
		<link>http://www.dynamicscrmtrickbag.com/2009/05/14/delete_audit/comment-page-1/#comment-3069</link>
		<dc:creator>Ralph</dc:creator>
		<pubDate>Mon, 06 Dec 2010 09:56:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.dynamicscrmtrickbag.com/?p=1040#comment-3069</guid>
		<description>Hi Richard!

I realise this blogpost is quite old but I wanted to ask you something.

When searching the internet for a way to find a deleted entity I sumpled upon this post and started wondering if it was possible to find an entity that has been deleted this way or another?

I really hope you read this and reply to me :-)</description>
		<content:encoded><![CDATA[<p>Hi Richard!</p>
<p>I realise this blogpost is quite old but I wanted to ask you something.</p>
<p>When searching the internet for a way to find a deleted entity I sumpled upon this post and started wondering if it was possible to find an entity that has been deleted this way or another?</p>
<p>I really hope you read this and reply to me <img src='http://www.dynamicscrmtrickbag.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Richard Knudson</title>
		<link>http://www.dynamicscrmtrickbag.com/2009/05/14/delete_audit/comment-page-1/#comment-478</link>
		<dc:creator>Richard Knudson</dc:creator>
		<pubDate>Fri, 21 Aug 2009 13:04:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.dynamicscrmtrickbag.com/?p=1040#comment-478</guid>
		<description>Yes, this is a good discussion...and a hard problem to solve! I think the main issue is that automatic workflows run in the security context of the owner of the workflow. I can&#039;t find anything in the workflow engine that gives you a handle to the user who triggered the workflow. 

At least the &quot;Owned by&quot; lookup attribute I put in there gets you who owned the record. (not that that solves the problem!)

Since the problem is that automatic workflows run as if they&#039;re being owned by the workflow owner, here&#039;s an admittedly kludgy workaround: what if instead of an organizationally scoped workflow you created separate workflows for each user (that is, make the workflow Owner the various users who might delete records), and give them a scope of User? In that case, whenever a user deletes a record, the workflow only kicks off for the specific user who deleted the record, and since that user is the owner of the workflow you can tell who deleted the record? 

For a small team this might work OK...although like I said, it&#039;s not what you&#039;d call elegant. I haven&#039;t tested this yet but I will when I get a chance. In the meantime, Karl, Mark, Anon, and anybody else...let me know what you think.</description>
		<content:encoded><![CDATA[<p>Yes, this is a good discussion&#8230;and a hard problem to solve! I think the main issue is that automatic workflows run in the security context of the owner of the workflow. I can&#8217;t find anything in the workflow engine that gives you a handle to the user who triggered the workflow. </p>
<p>At least the &#8220;Owned by&#8221; lookup attribute I put in there gets you who owned the record. (not that that solves the problem!)</p>
<p>Since the problem is that automatic workflows run as if they&#8217;re being owned by the workflow owner, here&#8217;s an admittedly kludgy workaround: what if instead of an organizationally scoped workflow you created separate workflows for each user (that is, make the workflow Owner the various users who might delete records), and give them a scope of User? In that case, whenever a user deletes a record, the workflow only kicks off for the specific user who deleted the record, and since that user is the owner of the workflow you can tell who deleted the record? </p>
<p>For a small team this might work OK&#8230;although like I said, it&#8217;s not what you&#8217;d call elegant. I haven&#8217;t tested this yet but I will when I get a chance. In the meantime, Karl, Mark, Anon, and anybody else&#8230;let me know what you think.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark</title>
		<link>http://www.dynamicscrmtrickbag.com/2009/05/14/delete_audit/comment-page-1/#comment-461</link>
		<dc:creator>Mark</dc:creator>
		<pubDate>Fri, 14 Aug 2009 18:40:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.dynamicscrmtrickbag.com/?p=1040#comment-461</guid>
		<description>The discussion is a good one. The last modified by is not a reliable indication of who deleted the record. Especially if you have other workflows that fired before this one. CRM seems to indicate the last modified by as the owner of the workflow, not the last person who actually modified the record. 

An easy test is to create a workflow that runs after a user changes the stage of the deal. The workflow would create an audit record indicating who changed the stage. That works, but then the modified by on the deal after the workflow has run will not be the person who changed the deal stage, it&#039;ll be the owner of the workflow. So, if a second workflow runs after that and creates say another audit record, it&#039;ll show the changed by as the previous workflow owner.

I have not found a way around this. I don&#039;t know why the workflows were designed to update the modified by. It makes it look like I was the last modified person on a ton of CRM records because I&#039;m the one who owns all the workflows. I get people emailing me asking why I modified a record. I haved to explain that I was not the one who modified it, a workflow ran and that&#039;s why it shows me.

Have you guys found a way around this?

-Mark</description>
		<content:encoded><![CDATA[<p>The discussion is a good one. The last modified by is not a reliable indication of who deleted the record. Especially if you have other workflows that fired before this one. CRM seems to indicate the last modified by as the owner of the workflow, not the last person who actually modified the record. </p>
<p>An easy test is to create a workflow that runs after a user changes the stage of the deal. The workflow would create an audit record indicating who changed the stage. That works, but then the modified by on the deal after the workflow has run will not be the person who changed the deal stage, it&#8217;ll be the owner of the workflow. So, if a second workflow runs after that and creates say another audit record, it&#8217;ll show the changed by as the previous workflow owner.</p>
<p>I have not found a way around this. I don&#8217;t know why the workflows were designed to update the modified by. It makes it look like I was the last modified person on a ton of CRM records because I&#8217;m the one who owns all the workflows. I get people emailing me asking why I modified a record. I haved to explain that I was not the one who modified it, a workflow ran and that&#8217;s why it shows me.</p>
<p>Have you guys found a way around this?</p>
<p>-Mark</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anon</title>
		<link>http://www.dynamicscrmtrickbag.com/2009/05/14/delete_audit/comment-page-1/#comment-422</link>
		<dc:creator>Anon</dc:creator>
		<pubDate>Wed, 15 Jul 2009 13:31:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.dynamicscrmtrickbag.com/?p=1040#comment-422</guid>
		<description>This is only correct if the deleting user also edited the record.  The delete action itself does not update the modified user value.</description>
		<content:encoded><![CDATA[<p>This is only correct if the deleting user also edited the record.  The delete action itself does not update the modified user value.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Richard Knudson</title>
		<link>http://www.dynamicscrmtrickbag.com/2009/05/14/delete_audit/comment-page-1/#comment-368</link>
		<dc:creator>Richard Knudson</dc:creator>
		<pubDate>Mon, 22 Jun 2009 15:40:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.dynamicscrmtrickbag.com/?p=1040#comment-368</guid>
		<description>Hi Karl -- 

Good catch -- since it&#039;s automatic it runs in the context of the owner...which means the record technically is deleted by the owner of the workflow. I&#039;ll fix it when I get a chance; probably the best approach (at least that I can think of off the top of my head) is to assume that the &quot;modified by&quot; is the same as the user who deletes the record. Do you think that would be a correct assumption?

Regards, Richard -- richardk@imginc.com</description>
		<content:encoded><![CDATA[<p>Hi Karl &#8212; </p>
<p>Good catch &#8212; since it&#8217;s automatic it runs in the context of the owner&#8230;which means the record technically is deleted by the owner of the workflow. I&#8217;ll fix it when I get a chance; probably the best approach (at least that I can think of off the top of my head) is to assume that the &#8220;modified by&#8221; is the same as the user who deletes the record. Do you think that would be a correct assumption?</p>
<p>Regards, Richard &#8212; <a href="mailto:richardk@imginc.com">richardk@imginc.com</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Karl P</title>
		<link>http://www.dynamicscrmtrickbag.com/2009/05/14/delete_audit/comment-page-1/#comment-349</link>
		<dc:creator>Karl P</dc:creator>
		<pubDate>Fri, 12 Jun 2009 20:03:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.dynamicscrmtrickbag.com/?p=1040#comment-349</guid>
		<description>This workflow sort of works but the modified by (deleted by) always shows &quot;SYSTEM&quot;.

Is there a way around this?</description>
		<content:encoded><![CDATA[<p>This workflow sort of works but the modified by (deleted by) always shows &#8220;SYSTEM&#8221;.</p>
<p>Is there a way around this?</p>
]]></content:encoded>
	</item>
</channel>
</rss>

