Tag Archives: Workflow

Publish Workflow On behalf of Some Other User. (Impersonation in Dynamics CRM)

Dynamic CRM workflow can generally only be published by owner. If you want to assign workflow to different support/sales manager and publish the workflow on their behalf then CRM does not allow you do it…

Then I found out about impersonation in CRM, as per this user account under which the impersonation code is to run must be added to the PrivUserGroup group in Active Directory. So your user account or admin user account who should have privileges to run code on behalf of someone else.

Once you have above things set up then it becomes easy do above task (i.e. Publish the workflow on behalf of someone else)

Following are steps to achieve this in Dynamics CRM.

Step 1: Add new button to workflow screen using ISV.Config.

This would look like as follows..

Step 2: Write Java script code for to publish the workflow one behalf to current workflow owner. If workflow is already published then unpublish the current workflow.

Download the java script code

Hope this helps..


Send the failed email again in Dynamics CRM

Sometimes because of various reason email created and send from CRM 4.0 fails to reach the destination and in this case CRM changes the email status to “Failed”
If you want to resend the email then you can easily do this using some simple workflow and then manually running this against the relevant emails. Following are the steps for the same..

Step 1: Go to Settings -> workflow – > click New

Step 2: Enter Workflow name “Send Failed email again” and then select entity as Email

Step 3: Remove/Deselect option to start this “Record is created” and select the option to run this on Demand as follows


Step 4: Now add step to send email as follows


Step 5: Now add steps to change the status of original email from failed to cancel so it does not pick up again. Finally publish the workflow

Step 6: select the relevant email with status “failed” and click run workflow button and select the workflow created in above step.

Done !!

Delete Read only/closed Record in CRM 4.0

Here is how to delete almost any Read Only / Closed item in CRM 4.0.Create a workflow to change the status of the item for closed to new or draft.
For Example…You just installed CRM 4 and are using some test accounts and creating some test invoices…You try to delete the test invoices after they are closed.. and what do you know? You can’t delete them! They are ‘Read only’!

So, you must create a workflow to change the status of the Invoice from Closed to New. To do this:

 Go to Settings Then Workflows
 New -> Type workflow name ‘Invoice Closed to New’
 Entity -> Invoice
 Click Ok.
 Check ‘Availability to run on demand’
 Uncheck everything else.
 Add Step -> Change Status
 It should read -> Change record status to: Invoice New
 Save the Workflow.
 Publish the Workflow.

Now go back to the invoice you want to delete. Open it. Run your newly created workflow on it. (Use the workflow button at the top)Close out of the Invoice, and wait for a min or two depending on the load of your system. Then, refresh your page. If the invoice status has changed, you can try to delete it!

Notes: –
1. This trick does not work on Contract record.
2. BE ADVISED -> I don’t know how this will affect any records associated to the items you are trying to delete. USE AT YOUR OWN RISK!!