How to edit Workflow steps via API? - dynamics-crm-2011

In my solution I have a workflow where one step contains a reference to Queue. After importing this solution on another CRM instance this workflow could not be activated because it contains an invalid reference - Queue can not be resolved. Queue with same name is created on new CRM but resolving is probably based on record Guid.
Now, I'm wondering, is there a way to edit workflow steps using CRM SDK? Whole process of CRM solution deployment is automated. And I want to remove all manual work. Some example would be great :)
Thanx in advance!

There are 2 things you can do if you are having issues with the Guids not matching in a workflow lookup when deploying from one environment to another.
Use the API to create those records referenced in the WF. When you create a record you can actually specify the Guid that it uses as the id. So write a tool or see if one exists already that will create some default data for your environment.
Use a configuration entity with references to all the EntityRefrences needed in your WFs. Then you can create a custom workflow activity to retrieve the configuration entity record (there should only ever really be one) that contains all the references in that environment.

Related

How to add a resource to project using workflow in NetSuite

As the title says...
I've successfully got workflows working that create project tasks, so I have some idea how the workflow customization tools work. But I'm struggling to see how I can (or even if I can) use a workflow to auto-magically add resources to the project (and then assign them to the project tasks I dynamically create.
Regarding which users/employees to add as resources, I imagine sorting out an appropriate clause shouldn't be too hard.
If I recall correctly, Resouces on a Project record are sublists. If I am correct, then it is not possible via workflows. There is a limitation with Workflows that they cannot work on record sublists.
You will have to do this via SuiteScript.

Need to troubleshoot a workflow

I am coming into an existing SCCD project and there is a custom field that is maintained between the Service Request and Incident forms. The problem is that the field is not being carried over properly. I suspect this is an issue within the workflow? Is there a proper way to debug or search for this problem area? So far, I've been poking around the 500+ workflow items for each the Service Request and Incident objects.
We ran into a similar situation where a custom field in the work order table was transfer over when we duplicated the work order. In that case, we had to look for the domain responsible for passing specific fields to be included in the duplication. It was a matter of adding the new custom field (dept) to the domain entry.
Other times, you may have to create an automation script, or modify the Java .class file (decode, rewrite, and recompile).

Workflow on "Activity"?

I'm trying to have CRM 2011 share activities to a Team if the user that created the record is part of another team.
Firstly, is it possible to create either a custom or basic workflow on "Activities" instead of having to create a workflow on each type of activity (Appointement, Phone Call, E-mail, etc.) that does the same thing on each of them ?
Secondly, I see the basic workflows wizard allows you to Assign activities to another team, but I don't see the Share action anywhere. Is this a job for a custom, .NET assembly, workflow ?
Thank you!
You need to select the exact entity when you create a workflow, this means you need to create a worklow for each activity entity-type (1 for Appointment, 1 for Phone Call, ...)
There isn't a built-in share functionality inside the standard Workflow designer, you need to use a custom activity (create one using .NET or install one already compiled)
Check these two:
http://crm2011workflowutils.codeplex.com/
http://crm2011sharestep.codeplex.com/

Automatically create record while creating a entity record

I have a project entity and a projectStages entity. I want, when a project record will be created automatically projectStages entities will be created for each stages.Till now I was doing it using plugin.
Just wanted to know if there is any way I within the CRM to do this.
this is a screen shot of the customer security roll.
Thanks.
I would do that using plugins, is there any reason you don't want to use plugins? You could use workflows to create projectstages when a project is created too, that will be asynchronous though.

CRM 2011 import mail workflows set up wrong 'From' field

I'm having a problem when copying customization between organizations with solution export/import.
That's every time that I copy data between different organizations/environments, I have to go through all workflows and change the references to CRM data, i.e 'From' field of an e-mail, that can be a queue or user mail.
In the new solution I have "Service" and it should be Service, so having the same name isn't a solution, so I think this is regarding to the GUID of the elements, but there is any option while exporting, I suppose, for avoid that, any freeware tool for that? Thanks!
This solution requires some .Net development, but once it is set up is pretty extensible. Either create a Configuration entity that only ever has one record or create an xml web resource that that stores all the environment variables like references to users, server settings url, etc.
To access your config entity (or web resource) from a Workflow you can create a simple workflow activity that just returns the first record of the configuration entity. Once you have it you can reference any property on it and since the data in that configuration is a record it unique to that environment.
Like I mentioned you can probably use an XML resource to do it, but retrieving an entity is easier, and you get the CRM UI for option sets and lookups and you can restrict who can edit it with security. You can also add new fields at any time and not ever have to change your WF activity code.

Resources