workflow error
-
Wednesday, January 30, 2013 5:09 AM
Hi Everyone,
I have created a custom workflow and i want to run this workflow on on demand on ribbon button click in dynamic crm 2011. But i m getting error the given key was not present in dictionary. I have usesd target entity in workflow for getting current entity guid.
Please help me.
All Replies
-
Wednesday, January 30, 2013 7:17 AMModerator
Hello,
You should not use Target. You should use following code inside your custom workflow activity:
IWorkflowContext context = executionContext.GetExtension<IWorkflowContext>(); IOrganizationServiceFactory serviceFactory = executionContext.GetExtension<IOrganizationServiceFactory>(); IOrganizationService service = serviceFactory.CreateOrganizationService(context.UserId); Entity currentEntity = service.Retrieve(context.PrimaryEntityName, context.PrimaryEntityId, new ColumnSet(true));
- Marked As Answer by Akhileshrajpoot Wednesday, January 30, 2013 11:49 AM
-
Wednesday, January 30, 2013 11:55 AM
Thanks Andrii. Its working now.
But i have another problem also.
How to debug a custom workflow. I have already added .pdb and .dll files in server assembly folder .
I have attached visual remote debugger with CrmAsynch Service.exe but its not working.
Please help me
-
Wednesday, January 30, 2013 12:17 PMModerator
Recheck following article - http://weblogs.asp.net/pabloperalta/archive/2010/12/01/how-to-remote-debug-dynamics-crm-plugins-and-workflow-assemblies.aspx
It could help you to set up remote debugging.
-
Thursday, January 31, 2013 4:28 AM
Hi Andrii,
I have used all steps according to above link provided by you but still i am not able to debug custom workflow. But debugger not coming on break point after attaching the crmAsyncService.
Cold you please help me.
-
Thursday, January 31, 2013 6:54 AMModerator
Hi Andrii,
I have used all steps according to above link provided by you but still i am not able to debug custom workflow. But debugger not coming on break point after attaching the crmAsyncService.
Cold you please help me.
This worked for me but doesn't for you. I have only one assumption - that you did something in wrong way. Try to repeat all the steps attentivelly. -
Saturday, February 09, 2013 5:13 AM
Hi,
I have created a asp.net webservice. In this service i have created a updatefunction with parameters list and i want to call this function by crm2011 javascript on page load for update the field of incident entity.
Please help me how i will call this web service in crm.
- Edited by Akhileshrajpoot Saturday, February 09, 2013 5:13 AM