This project has moved and is read-only. For the latest updates, please go here.

Custom Workflow Activity Clone Record Error

Mar 23, 2016 at 3:19 PM
Plugin Trace:

[msdyncrmWorkflowTools: msdyncrmWorkflowTools.CloneRecord]
[msdyncrmWorkflowTools (1.0.16.0): msdyncrmWorkflowTools.CloneRecord]
Load CRM Service from context --- OK
ObjectTypeCode=4201--ParentId=f038c59c-77d1-e511-8112-3863bb355d80
retrieved object OK
attribute:isbilled
attribute:isworkflowcreated
attribute:attachmenterrors
attribute:prioritycode
attribute:timezoneruleversionnumber
attribute:scheduledstart
attribute:regardingobjectid
attribute:subject
attribute:organizer
attribute:ownerid
attribute:scheduleddurationminutes
attribute:location
attribute:ismapiprivate
attribute:requiredattendees
attribute:optionalattendees
attribute:isalldayevent
attribute:scheduledend
attribute:statuscode


Error Message:

Unhandled Exception: Microsoft.Crm.CrmException: 5 is not a valid status code for state code AppointmentState.Open on appointment with Id 19674505-fff0-e511-80d6-5065f38b2521.
at Microsoft.Crm.Sandbox.SandboxCodeUnit.Execute(IExecutionContext context)
at Microsoft.Crm.Workflow.Services.ProxyCustomActivity.Execute(CodeActivityContext executionContext)
Coordinator
Mar 24, 2016 at 9:35 AM
Maybe this is an issue...
This is an error when you try to clone an appointment that is completed? or it occours always?
Mar 24, 2016 at 9:57 AM
No the appointment is not Completed.
I run a workflow to clone an appointment with statecode = Scheduled
Coordinator
Mar 24, 2016 at 11:45 AM
Hi mtonarelli, I found the error on the state, and I solved. Sometimes records doesn't crete on default state, so to be duplicated, I ned to create, and the after that, set the state. This point is solved, but I found another error with the partylists, so I'm working on it.

regards
Coordinator
Mar 24, 2016 at 11:59 AM
Edited Mar 24, 2016 at 12:04 PM
Solved both issues on version 1.0.18.2 (see source code).
Also updated the Solution.

Thanks mtonarelli for your help ;)
Marked as answer by demian_rasko on 4/2/2016 at 1:35 AM
Mar 24, 2016 at 12:18 PM
Thank you for the workflow tools CRM solution.
I do some tests and let you know.
Apr 4, 2016 at 10:50 PM
I have create an Asynchronous Workflow on demand to clone an appointment.
Select the appointment to clone and run the workflow.
At the end i dont' have 2 only records the original record and the clone but i have 14 records !