Dynamics 365: Prevent firing plugin execution while updating record - dynamics-crm

I want to update a field without firing the plugin execution. I tried to update it with SQL 4 CDS, but the plugin executes and I get a timeout error (This plugin is updating all child records, but at this case we want to bypass this). Is there a way to achieve this?

In C# you can actually do this using an UpdateRequest.
You would create the request like this:
var request = new UpdateRequest
{
Target = entity,
["BypassCustomPluginExecution"] = true
};
Important note: users must have the prvBypassCustomPlugins privilege to make this work. This privilege cannot be assigned through the UI and only the System Administrator role has this privilege by default.
See also Bypass Custom Business Logic - MS Learn.

I found a way to update record without triggering plugins. At SQL 4 CDS, in Settings menu there is an option "Bypass custom plugins" as you can see at the screenshot below. By checking this option, you can update the record without triggering plugin execution

Related

Process "Automatic Row Processing (DML)" not obeying Form edit authorizations in attributes

I have a region of type Form and a process of type Automatic Row Processing (DML) for this form. I've configured the form edit authorization schemes (in Attributes) for each operation: Add, Update and Delete:
But the process doesn't obbey the authorization schemes. It always runs. Here is my proccess:
I've applied the same authorization schemes on the buttons CREATE, SAVE and DELETE, and they are disappearing accordly. But a malicious user can execute this command on browser console with success, even if the related authorization scheme returns false: apex.page.submit("DELETE");
Am I doing something wrong? Or this is a security fail?
Oracle Apex 19.1
Thanks in advance.
I just tried this on my own APEX 19.2 application and was able to reproduce the issue. It does seem odd to me that you are able to perform these actions without having the proper authorization. Thanks for the heads up!
I was able to work around the issue by adding an Authorization Scheme to my Form - Automatic Row Processing (DML).
Since you have a CREATE, SAVE, and DELETE button, you may have to set up 3 Form - Automatic Row Processing (DML) Processes, set up each one to only execute on the When Button Presssed condition (one for each button) and assign the appropriate Authorization Scheme to each Process.

Dynamics 365 - A check to ensure that all tasks have been complete

I have a scenario where the user wants a check in place to ensure that all tasks have been completed before moving onto next stage on the Business Process Flow.
Is there anyway to do this?
2 ways to achieve it.
Option 1: Create a bool field - Tasks closed? & keep that in BPF step, if it’s true then platform will also users to move forward. Otherwise not.
You can mark this as read-only, write a plugin on Task completion to update this as yes, when there is no more open tasks.
Read more
Option 2: Can have a js validation onStageChange or onSave to retrieve open child tasks, check the count, show notification & preventDefault.
Read more
You can do the same in pre-update plugin, throw InvalidPluginExecutionException if there are open tasks.

Why does Dynamics CRM 2013 plugin fire twice on owner change?

I have a simple plugin for a custom entity that is set to trigger on Update of my custom entity. It is registered in the Post Operation stage. I have noticed some strange behaviour when I make changes to the Owner field of the record in addition to other standard fields (e.g. text boxes, dates etc).
The plugin fires the first time and the only attributes that come across in the image are all the regular fields. The owner field does not come across.
The plugin then fires again, but the Depth property of the context is still only one (i.e. the plugin is not getting triggered by changes made in the plugin code). In this run of the plugin, the attribute that come across is only the Owner field.
My theory is that because the owner fields are 'special', the CRM is doing two different requests - one to change the regular fields, and then another request for changing the owner via an AssignRequest. However, I cannot find any 'official' documentation for this behaviour.
Can someone explain why this is happening?
I am running Dynamcs CRM 2013 UR2
The Update event fires during the Assign event. So if an assignment takes place your plug-in will execute. The same is true for SetState - if you activate/deactivate a record an Update event takes place. These items are not documented in the SDK.
A good practice is to use Attribute Filtering on your Update plugin so it only fires for the fields it is concerned about - this will, assuming it is isn't looking at the owner related fields, avoid it firing twice. If you have logic specific to record ownership you would put it in a plugin that is registered on the Assign event.
I was not able to find official documentation about this, but I think Assign message is what you are looking for (if the entity is user-owned. See http://msdn.microsoft.com/en-us/library/gg328576.aspx. I would strongly recommend that you specify Filtering Attributes if you are registering a plugin on Update message. You could also debug your plugin and inspect MessageName property of plugin context and see what message gets triggered. I hope this helps.

Is it possible to get parameters of an unpublished plugin without querying the database directly?

Is there a Joomla 2.5.x API that would allow for retrieval of a plugin information(i.e. parameters) if the desired plugin is unpublished?
Why: We have a few plugins that are only enabled in production and I'm looking for a way to get at some of the parameters programmatically and without querying the database directly.
Try something like
$userPlugin = JPluginHelper::getPlugin('user', 'joomla'); // group, specific - optional
$userPluginParams = new JRegistry();
$userPluginParams->loadString($userPlugin->params); //get the string as a jregistry
$useStrongEncryption = $userPluginParams->get('strong_passwords', 0); // get the one you want.
Here's a workaround to make it not run but still able to get:
Okay how about this for a trick/workaround. Did you realize plugins have access levels? Why don't you create an access level with no one in it and assign to the plugin as the only level it runs for. Then you can publish it but it won't run.

CRM 2011 Plugin for Create Email not triggering on Pre-validation

I'm relatively new to the CRM SDK, and I'm trying to write a plugin to alter From/CC fields of an email on Create. It seems when this is registered in Pre-operation, the ActivityParty collection cannot be modified(though things like subject and body can be modified), and this post recommended setting the pipeline stage to Pre-validation.
When I do this the plugin no longer gets triggered. I know this because when remote debugging, breakpoints are only hit when pre-operation is selected. Also, when not remote debugging, none of the other changes get implemented in the plugin code.
Does anyone know what might be preventing this plugin from executing?
When you register plugin on Create message fields To, CC, BCC will be empty. Try register on DeliverIncoming / DeliverPromote messages

Resources