Why Pre-Operation is used during Update a Plug-In - plugins

In Microsoft Dynamics CRM Plug-in why at Event Pipeline stage of execution is used Pre-Operation for "Update" message while adding a step in a plug-In. could anyone elaborate this?

The plugin pipeline includes the following stages; pre-validation, pre-operation, and post-operation.
Apart from a couple of exceptions these stages are always available. So for the update message the pre-operation is there because that is how the product is designed to work.
In an update message the pre-operation stage could be used for example to:
Stop plugin execution by throwing an exception.
Inspect values of the record before they are changed.
Alter the plugin Target object to change the update applied to the record.

MSDN elaborates quite a bit about it: see Event Execution Pipeline.
Abstract (copy-pasted from the linked page):
The Microsoft Dynamics CRM event processing subsystem executes
plug-ins based on a message pipeline execution model. A user action in
the Microsoft Dynamics CRM Web application or an SDK method call by a
plug-in or other application results in a message being sent to the
organization Web service. The message contains business entity
information and core operation information. The message is passed
through the event execution pipeline where it can be read or modified
by the platform core operation and any registered plug-ins.

Related

Dynamics Crm workflow avoid update of record

In a CRM 2016 online real-time workflow, is it possible to avoid a record to be updated? In particular i created a real-time workflow of the type "before record status updated", and my objective is that I don't want an opportunity to be activated, if the value of a field of the opportunity is "yes".
Is this behaviour achievable with a workflow, or I need a plugin?
Just for chucks and giggles: As you said it is a real time workflow, you could use a custom workflow activity to throw an error, that would prevent record creation or update as real time workflows are transactional with the create/update operation.
Recommended: Synchronous plugins were put in place exactly for this very reason, to perform business validations and complex business operations.
To use the system as intended, use a plugin.

Jenkins Workflow API - stage status

What information are we able to query on a workflow job? Anything regarding a particular build's stage status (succeeded, failed, hasn't reached yet, aborted, etc.)? I see we can interact with the input step using this method, but where can we find what metadata, if anything, can be obtained about our builds?
The REST exported API for builds (…/job/…/…/api/json?tree=…) is not very extensive yet. You can get some information about nodes in the flow graph (steps, and some associated block nodes—the stuff you see in Workflow Steps). It is possible to extract some information about stages from that, albeit not easily. Much more is available from the Java API.

CRM 2011 custom Plugin passing parameters to processes

We are trying to automate a few things in CRM and I have an idea about how to go about it while still allowing customizations from the Process section in CRM Settings.
The problem: We receive a lot of E-mails from an account that are added to a Queue. This queue fills up faster than we can clear it. Most of these E-mails have a standard format and the user only has to read a few lines of the the E-mail body to figure out what to do. There's a total of 6 different workflows that the user would do. These haven't been implemented.
Reading the documentation of CRM, I figured that I would need a custom Plug-in that would parse the E-mail body, and trigger a workflow in CRM according to the values in the E-mail. I also need some of the values that the E-mail contains to be passed to the workflow. I already have the Plug-in setup to do this.
The problem I run into is creating a process which takes in custom parameters passed over by the Plug-in I created. I need to access these values in the front-end (one of the Processes in CRM Settings). Is this possible? If not, is there another way to achieve this?
Is there a reason you used a Plugin to kick-off this automation instead of a Custom Workflow (which is a Process)? You could perform the parsing of the E-mail inside your Custom Workflow, and use its InOutArgument properties to pass values into subsequent child workflows.
Definition: https://msdn.microsoft.com/en-us/library/gg327984(v=crm.5).aspx
Sample: https://msdn.microsoft.com/en-au/library/gg334455(v=crm.5).aspx

microsoft CRM plugin and DB save

We have written plugin for Microsoft CRM that is run after an entity is created, and ideally we would like it to run after it has been saved to the database as well. If we set it to process synchronously it fires before our database trigger has had time to modify the entity record.
If we set the plugin to process asynchronously is it assured to have been saved to the database before the plugin is fired, or is there a possible race condition there?
Did you set your own triggers on CRM database tables ? It is not advisable to do so; all operations on the database should be done through the CRM webservice to ensure you're not breaking anything. Also, custom triggers are not guaranteed to survive when CRM Update Rollups are installed. You should always use plugins instead.
Other than that, an asynchronous plugin only fires after the database update is through, as does a synchronous plugin in the post stage; the difference is that the operation (CRM webservice call, saving the CRM form etc.) does not block until the plugin has run, so in the case of saving a record's form, the form will not usually reflect the changes an asynchronous plugin makes because the plugin has not run when the form starts reloading after the postback.

Microsoft CRM 4.0 Workflow: How can I email a list of related Entities?

I'm building a workflow in Microsoft CRM 4.0 for an Entity E1. In this wf, I have to send an email. In the email, I have to print all entities of E1 that match certain conditions.
For example, it would be great the following mail:
Hi Carl, this is your list of account created until yesterday:
account1, info
account2, info
account3, info
Ho can I do it? It seems I can't!
You will have to code a custom workflow assembly to create this type of email.
Depending on when you need this kicked off there is actually a convoluted way to handle using native workflows. If it will be kicked off when a field on the parent entity changes to a certain value then do this.
On the child entity create a workflow that runs on create and is a child workflow. The first step should be to wait until the relevant field on the parent entity has the correct value.
Then under the wait condition, send your email
Finally start the workflow again as a child workflow
Then end the current workflow.
You can do also sorts of neat hacks if you aren't afraid of waiting workflows