serving the solutions day and night

Pages

Showing posts with label plug-in. Show all posts
Showing posts with label plug-in. Show all posts

Wednesday, March 30, 2016

MS Dynamics CRM - Generate Unique/Auto Number

MS Dynamics CRM doesn't contain auto increment number attribute. My client was assigned each unique registration number for contact entity.
There is lot options available in the market, but i used very easy code to achieve this task. I used pre create plugin operation to create new registration unique/auto number. Number will be create on while saving the record.

i created one custom entity (dns_global), it will keep last reg number.

Dynamics CRM - Update Contact Fullname

My client want the fullname with the suffix and custom order like LastName, FirstName Middle Name Suffix. Dynamics CRM System Settings doesn't have the option to set the custom order fullname. Contact entity fullname is readonly attribute, it won't allow to update the fullname directly.

You can update through only pre create or update operation plugin.

Tuesday, March 1, 2016

Dynamics CRM Action

CRM Action is a process that allows a user to create it and add custom Workflow, but Action is only be able to be called or triggered by client (Javascript) or server code (C#).

Actions can be defined for an entity or none (Global entity).

Custom Action can be used as Custom Message or Event Handle and can be registered by using Plugin Registration Tool.

Example, storing config parameters (like server url), custom error message, used for complex business code, single point of integration for third party systems.

Create an Action without no steps, message name is edm_TestActionName, entity is none, passing one input ContactID (reference) & one output ValidContact (boolean) parameters. Activate it

Generate an Early Bound Class to get your action in your class library, refer this blog http://makdns.blogspot.com/2012/11/crmsvcutilexe-crm-dynamics-2011-code.html (parameter /generateActions)

Create a Plugin Class, compile & deploy

Tuesday, April 15, 2014

Dynamics CRM 2011 Activities Code & Configuration

Dynamics CRM 2011 Activities Code & Configuration

1.Activities Code

//Added Service Reference, reference name is 'ServiceEmailAudit'
//Code to Create Activities, this will get input field and call webservice
using System;
using System.Activities;
using System.ServiceModel;
using Microsoft.Xrm.Sdk;
using Microsoft.Xrm.Sdk.Workflow;
using System.Linq;
using DNS.CRM.Entities;

namespace CRM.EmailAudit.Activities
{
    public class GenerateDAEmail : CodeActivity
    {
        [RequiredArgument]
        [Input("Report Name")]
        public InArgument<string> iReportName { get; set; }

Tuesday, September 10, 2013

Improve PrincipalObjectAccess (POA) and AsyncoperationBase table performance in MS Dynamics CRM 2011

PrincipalObjectAccess (POA) table

Grant permission for a user to see/edit/delete a record in CRM.

Permissions are granted is through either Direct or Inherited shares. 

Direct Shares are the user shares a record to another user or team through the 'share' button in the ribbon. These records will have a value in the AccessRightsMask colum of the POA table.

Inherited Shares are the result of a number of different configuration rules – such as the shares that cascade to an object based on the ownership of its parent record, Custom code that shares a record, or by the system due to relationship behaviors or system settings. These records will have a value in the InheritedAccessRightsMask colum of the POA table.

The shares granted on objects in CRM are stored in the PrincipalObjectAccess (POA) system table. Since almost every access to CRM data interacts with the POA table.

Tuesday, May 7, 2013

Dynamics CRM Workflow

Dynamics CRM Workflow
Typical workflow actions include sending an email message, creating a task, and updating a data field on a record.
Dynamics CRM workflow uses the Windows Workflow Foundation framework for its core infrastructure.
Dynamics CRM workflow is Asynchronous Processing Service.
Dynamics CRM workflow processes in one of three ways: Manually by the user, Automatically from a trigger event & From another workflow
Workflow Process Security - Creating and editing workflow processes & Running workflow processes (Manual or Automatic).
Settings -> Process Center -> Processes

Create a workflow process
Enter a process name, select entity, select Workflow as the category and select new bank process, Press OK


Friday, May 3, 2013

Differences between Dynamics CRM Workflows and Dialogs and Plug-ins

Differences between Dynamics CRM Workflows and Dialogs
WorkflowsDialogs
Can be either started by a user or can be automated.Must be started by a user.
Asynchronous processes, and no user input. background process.Synchronous processes, require user input, a wizard-like interface will popup
Triggers are supported for workflowsTriggers are not supported for dialogs.


Differences between Workflows and Plug-ins
Plug-in Workflow
Executes immediately before or after the core operation (synchronous).Can also be queued to execute after the core operation (asynchronous). Queued to execute after the core operation (always asynchronous).
Synchronous plug-ins can increase the platform’s response time because they are part of the main platform processing. Asynchronous plug-ins have less impact on server response time because the code is run in a different process. Less impact on server response time because the code is run in a different process.
To register a plug-in with the platform requires a System Admin or System Customizer security role and membership in the Deployment Administrator group. Users can interactively create workflows in the Web application. However, to register a custom workflow activity, the deploying user must have the same security roles as those required for registering plug-ins.
A plug-in registered for synchronous or asynchronous execution is restricted to complete its execution within a 2 minute time limit. Works well for either short or long processes.
Both online and offline are supported. Works when the Microsoft Dynamics CRM for Outlook client is offline Workflows do not execute when offline.
Plug-ins execute to completion. Plug-ins must be written to be stateless where no in-memory data is persisted. Workflows can be paused, postponed, canceled, and resumed through SDK calls or by the user through the Web application. The state of the workflow is automatically saved before it is paused or postponed.
Plug-ins can perform data operations on behalf of another system user. Workflows cannot use impersonation.


Differences between Background(Asynronous) VS Run-time Workflow
Real Time Workflow:
1. An RTW triggered on a particular event (e.g. Create, Update, Assign and Delete) can also be configured to run on demand. This will still run immediately once triggered rather than being queued to run at later point of time as an asynchronous workflow would.

2. Unlike an async workflow, when a real time workflow runs it can do so in the context of the workflow owner, or can be configured based on user who made changes to record.

3. RTW do not contain any delay or wait activities step.

4. CRM users must have organizational permission on the following two security levels to create and activate a real time workflow:

CRM provides an option to convert existing asynchronous workflows into real time workflows without the need to define any manual steps & vice-versa...

Asynchronous Workflow:
Asynchronous workflows do remain an important option for carrying out high volumes of processes which aren't time critical, for example creating activities or sending emails. In these examples the operation will take place without halting the user process.

Wednesday, April 17, 2013

CRM Plugin Code - Add/Update Entity, Connect WebService, Update Database

//Update Same Entity, Other entity, create new record in other entity  and connect to WebService
//Update to database  and
//Webservice update to database

using System;
using System.Diagnostics;
using System.Linq;
using Microsoft.Xrm.Sdk;

using Microsoft.Xrm.Sdk.Query;
using System.Xml;
using System.Net;
using GCEntity = CRMEnt.Entities;
using System.Text;
using System.ServiceModel;

CRM 2011/2013 Development Toolkit

http://msdn.microsoft.com/en-us/library/hh372957%28v=crm.6%29.aspx

With the Developer Toolkit, you can do the following:
  • Easily generate strongly typed proxy classes without having to run CrmSvcUtil.exe.
  • Generate plug-in code so you can immediately begin to write code for business logic.
  • Edit and register plug-ins without using the Plug-in registration tool.
  • Create new web resources or extract existing web resources, add them to your solution, edit them, and deploy changes all within Visual Studio.
  • Create and edit workflow and dialog processes from within Visual Studio.
  • Get easy access to entity and option set definitions, security role and field security profile information in Visual Studio.
Download SDK http://www.microsoft.com/en-us/download/details.aspx?id=40321

Saturday, March 16, 2013

Dynamics CRM Plugin Registration Tool

Download and Export
  1. Download and install latest Dynamics CRM SDK  from Microsoft.
  2. Export "pluginprofiler.solution" package (get it from sdk\bin) to your CRM solution.
Connect to the Microsoft Dynamics CRM Server
  1. Run the PluginRegistration.exe tool from sdl\bin folder of the SDK download.
  2. To run the Plug-in Registration tool, you must first install the Windows Identity Foundation
  3. Click Create New Connection.
  4. Click connect to the Microsoft Dynamics CRM Server, you should see a list of available organizations that you belong to in the Connections pane.