TextBox

Tag cloud

    RecentPosts

    Mercure Integration: Dedicated to Microsoft CRM Integration Products

    404 not found on Service proxy

    by support 8. September 2009 15:19

    When using the proxy inside a plug-in, you might had a 404 not found. A solution was found here

    http://m3r.ca/g/xlk5

    And this was not corrected in the Roll Up 6.

    -f.

    keyword for search engine...

    SdkTypeProxyCrmServiceWrapper

    Microsoft.Crm.Extensibility.SdkTypeProxyCrmServiceWrapper.Update 404

    crm 80040265

    Tags:

    Development

    x32 & x64 versions of the SDK

    by support 29. August 2008 10:53

    Yes, you understand correctly, even if you are developing in .NET, you must use the appropriate SDK Assemblies. And this was introduced in the latest (to date) SDK version , v.4.0.5.

    Here is a brief example on how you must choose the assemblies, by Ross Lotharius

    http://rosslotharius.com/archive/2008/08/07/crm-plugins-in-a-64-bit-environment.aspx

    If you are not using the right version, this error can occurred

    Unhandled Exception: System.BadImageFormatException: Could not load file or asse
    mbly 'Microsoft.Crm.SdkTypeProxy, Version=4.0.0.0, Culture=neutral, PublicKeyTok
    en=31bf3856ad364e35' or one of its dependencies. An attempt was made to load a p
    rogram with an incorrect format.

    -f.

    Tags:

    Development

    Plug-in on a nondefault organization, 401 unauthorized

    by support 3. June 2008 07:30

    >Crm Exception: Message: Organization With Name = Full Organization Name Does Not Exist, ErrorCode: -2147220969

    http://support.microsoft.com/kb/948746

    There is an hotfix, but here is a workaround: Change the display name and rename it to the Unique Name.

    -f.

    Tags:

    Development

    0x80040216 when issuing a Send on an email in an assembly

    by support 3. June 2008 06:17

    The answer is simple, access rights. The modification resides in calling

    IContextService contextService = (IContextService)executionContext.GetService(typeof(IContextService));
    IWorkflowContext context = contextService.Context;
    ICrmService crmService = context.CreateCrmService(false);

    not

    IContextService contextService = (IContextService)executionContext.GetService(typeof(IContextService));
    IWorkflowContext context = contextService.Context;
    ICrmService crmService = context.CreateCrmService(true);

    Because the administrative web services cannot issue tracking token... ! and you receive this error in the logs...

    ---> System.InvalidCastException: Specified cast is not valid.
    at Microsoft.Crm.ObjectModel.TrackingManager.GetNextTrackingToken(String subject, String& trackingToken)
    at Microsoft.Crm.ObjectModel.EmailService.Send(Guid emailId, Boolean issueSend, String trackingToken, ExecutionContext context)

    -f.

    Tags:

    Development

    NoCode Workflow: Some issues, part 1

    by support 13. March 2008 11:19

    To help others (and to remember howto fix the issue), here is a problem that I had.

     

    I am developping some nocode Workflows, and when It was the time to unpublish it using the tools provided by the SDK, I had an unhandled exception.

    Why? The stack trace below is detailing that when it's time to unpublish, the registered step are updated to remove the references on the dependencies. The problem is that when uploading the workflows, the steps were not created with empty attributes, so, when it was the time to update them, the row in the SdkMessageProcessingStepImageBase where returned with a null field, instead of an empty field. I have done an update on the database (yeah, it's a test environment, and, anyway, the nocode workflows are not supported for this version).

    Now, to avoid that, what's the solution?

    I think it's a symptom of the unsupported portion. Maybe it's a check that the import is not doing, and that's a side effect... so there is no solutions. I tried to redeploy (after unpublishing and deleting the workflow), and it was working...

    -f.

     

    Error: Exception of type 'System.Web.HttpUnhandledException' was thrown.
    Error Message: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
    Error Details: Exception of type 'System.Web.HttpUnhandledException' was thrown.
    Source File: Not available
    Line Number: Not available
    Request URL:
    http://theserver/theorg/_grid/cmds/dlg_deactivate.aspx?iObjType=4703&iTotal=1&iIndex=0&iStateCode=-1&iStatusCode=1&iId={5D8DFD50-41A6-4D5C-BF2D-779711A3AE17}
    Stack Trace Info: [NullReferenceException: Object reference not set to an instance of an object.]
    at Microsoft.Crm.ObjectModel.WorkflowServiceInternal`1.UpdateSdkStepImages(String preImageEntityAttributes, String postImageEntityAttributes, Guid SdkMessageProcessingStepId, ExecutionContext context)
    at Microsoft.Crm.ObjectModel.WorkflowServiceInternal`1.CheckRemoveWorkflowExpansionStep(Guid activationId, Int32 primaryEntityTypeCode, ExecutionContext context)
    at Microsoft.Crm.ObjectModel.WorkflowServiceInternal`1.Unpublish(BusinessEntityMoniker moniker, ExecutionContext context)
    at Microsoft.Crm.ObjectModel.WorkflowServiceInternal`1.SetState(BusinessEntityMoniker moniker, Int32 newState, Int32 newStatusCode, ExecutionContext context)
    at Microsoft.Crm.BusinessEntities.BusinessProcessObject.SetStateStatus(BusinessEntityMoniker moniker, Int32 newState, Int32 newStatusCode, ExecutionContext context)
    at Microsoft.Crm.ObjectModel.WorkflowService.Microsoft.Crm.Sdk.IStateful.SetStateStatus(BusinessEntityMoniker , Int32 , Int32 , ExecutionContext )
    [TargetInvocationException: Exception has been thrown by the target of an invocation.]
    at Microsoft.Crm.Application.Utility.Util.RaiseXMLError(Exception exception)
    at Microsoft.Crm.Dialogs.DeactivateDialogPage.ConfigureForm()
    at Microsoft.Crm.Application.Controls.AppUIPage.OnPreRender(EventArgs e)
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
    [HttpUnhandledException: Exception of type 'System.Web.HttpUnhandledException' was thrown.]
    at System.Web.UI.Page.HandleError(Exception e)
    at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
    at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
    at System.Web.UI.Page.ProcessRequest()
    at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context)
    at System.Web.UI.Page.ProcessRequest(HttpContext context)
    at ASP.vmnet__grid_cmds_dlg_deactivate_aspx.ProcessRequest(HttpContext context)
    at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
    at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

    Tags:

    Development

    Some CRM 4.0 Enums

    by support 7. March 2008 04:59

    A quicky for today...

    AuthenticationType

    AD 0 Specifies Active Directory authentication.
    Passport 1 Specifies Passport authentication.
    Spla 2 Specifies Internet Facing Deployment authentication (formerly known as SPLA).

    WorkflowType

     

    Activation 2 Specifies an activation workflow.
    Definition 1 Specifies a workflow definition.
    Template 3 Specifies a workflow template.

    WorkflowDependencyType

     

    Field Value Description
    AttributeDefinition 8 Specifies a dependency on an attribute definition .
    CustomEntityDefinition 7 Specifies a dependency on a custom entity definition.
    LocalParameter 2 Specifies a dependency on a local parameter.
    PrimaryEntityImage 3 Specifies a dependency on a primary entity image.
    PrimaryEntityPostImage 5 Specifies a dependency on a primary entity post image.
    PrimaryEntityPreImage 4 Specifies a dependency on a primary entity pre image.
    RelatedEntityImage 6 Specifies a dependency on a related entity image.
    SdkAssociation 1 Specifies a dependency on an SDK association.

    -f.

    Tags:

    Development

    Standalone Workflow Configuration and Deployment

    by support 6. March 2008 06:19

    When I compiled, open and tried the CrmWorkflowConfigurationAndDeployment project, I saw that this was integrated with the Visual Studio IDE. The problem is, that I compiled my own workflow and that the tool gives me an error when I wanted to deploy it on my CRM 4.0 server.

    This tool is great, but, when it's the time to debug it, I don't want to launch, an IDE, and attach an other IDE to the Visual studio addin, just to know what is going on, and after redeploy the Addin just to see if the bug is fixed.

    I converted the VS Addin to a stand alone application, by adding a program.cs and a master form that call the 3 forms of the workflowconfigurationtool project, in the SDK samples.

    The program.cs form:

    using System;
    using System.Collections.Generic;
    using System.Text;
    using System.Windows.Forms;
    
    namespace Microsoft.Crm.Sdk.Tools
    {
        static class Program
        {
            /// <summary>
            /// The main entry point for the application.
            /// </summary>
            [STAThread]
            static void Main()
            {
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                Application.Run(new Master());
            }
        }
    }
    and the master.cs form
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Text;
    using System.Windows.Forms;
    
    namespace Microsoft.Crm.Sdk.Tools
    {
        public partial class Master : Form
        {
            /// <summary>
            /// Required designer variable.
            /// </summary>
            private System.ComponentModel.IContainer components = null;
    
            /// <summary>
            /// Clean up any resources being used.
            /// </summary>
            /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
            protected override void Dispose(bool disposing)
            {
                if (disposing && (components != null))
                {
                    components.Dispose();
                }
                base.Dispose(disposing);
            }
    
            #region Windows Form Designer generated code
    
            /// <summary>
            /// Required method for Designer support - do not modify
            /// the contents of this method with the code editor.
            /// </summary>
            private void InitializeComponent()
            {
                this.btnConfiguration = new System.Windows.Forms.Button();
                this.btnDeploymentManager = new System.Windows.Forms.Button();
                this.btnServerSettings = new System.Windows.Forms.Button();
                this.SuspendLayout();
                // 
                // btnConfiguration
                // 
                this.btnConfiguration.Location = new System.Drawing.Point(12, 41);
                this.btnConfiguration.Name = "btnConfiguration";
                this.btnConfiguration.Size = new System.Drawing.Size(140, 23);
                this.btnConfiguration.TabIndex = 0;
                this.btnConfiguration.Text = "&Configuration";
                this.btnConfiguration.UseVisualStyleBackColor = true;
                this.btnConfiguration.Click += new System.EventHandler(this.button1_Click);
                // 
                // btnDeploymentManager
                // 
                this.btnDeploymentManager.Location = new System.Drawing.Point(12, 12);
                this.btnDeploymentManager.Name = "btnDeploymentManager";
                this.btnDeploymentManager.Size = new System.Drawing.Size(140, 23);
                this.btnDeploymentManager.TabIndex = 1;
                this.btnDeploymentManager.Text = "&Deployment Manager";
                this.btnDeploymentManager.UseVisualStyleBackColor = true;
                this.btnDeploymentManager.Click += new System.EventHandler(this.btnDeploymentManager_Click);
                // 
                // btnServerSettings
                // 
                this.btnServerSettings.Location = new System.Drawing.Point(12, 70);
                this.btnServerSettings.Name = "btnServerSettings";
                this.btnServerSettings.Size = new System.Drawing.Size(140, 23);
                this.btnServerSettings.TabIndex = 2;
                this.btnServerSettings.Text = "&Server Settings";
                this.btnServerSettings.UseVisualStyleBackColor = true;
                this.btnServerSettings.Click += new System.EventHandler(this.button2_Click);
                // 
                // Master
                // 
                this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
                this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
                this.ClientSize = new System.Drawing.Size(164, 106);
                this.Controls.Add(this.btnServerSettings);
                this.Controls.Add(this.btnDeploymentManager);
                this.Controls.Add(this.btnConfiguration);
                this.MaximizeBox = false;
                this.MinimizeBox = false;
                this.Name = "Master";
                this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
                this.Text = "Workflow";
                this.ResumeLayout(false);
    
            }
    
            #endregion
    
            private System.Windows.Forms.Button btnConfiguration;
            private System.Windows.Forms.Button btnDeploymentManager;
            private System.Windows.Forms.Button btnServerSettings;
    
            public Master()
            {
                InitializeComponent();
            }
    
            private void btnDeploymentManager_Click(object sender, EventArgs e)
            {
                DeploymentManager dm = new DeploymentManager();
                dm.Show();
            }
    
            private void button1_Click(object sender, EventArgs e)
            {
                ConfigurationForm cf = new ConfigurationForm("");
                cf.Show();
            }
    
            private void button2_Click(object sender, EventArgs e)
            {
                ServerSettings ss = new ServerSettings();
                ss.Show();
            }
        }
    }

    -f.

    Tags:

    Development

    HOWTO: Working with Plugins, a tutorial using the Plugin Registration Tool

    by support 26. February 2008 06:31

    I have searched a lot, and I did not see a complete tutorial on how to work with plugins. Here it is, and I hope I'm not missing something, or saying something wrong.

    In the registration tool package, there is a walkthrough specifically for the Registration Tool. Worth to take the look at it.

    Here is how to create, register and use a plugins from the code to the deployment, using the new Plugin Registration Tools

    First, the plug in.

    For the purpose of demonstration, I simply used the accountcreateplugin provided with the SDK.

    The code of the AccountCreateHandler Class can be found on MSDN.

    The important point in this code is the Verify Execution Context part which is verifying that there is a target parameter, and that the target entity is an Account.

    Add reference to the Microsoft.Crm.Sdk and Microsoft.Crm.SdkTypeProxy assemblies, and you can compile it. Do not forget to go in the project signing tab and to strong name the assembly. It is required.

    image

    Second, the assembly registration

    Using the new Plugin Registration Tool version 2, access to your CRM 4.0 Server, and select the organization in which you want to deploy the plugin. Like everything else, the plugins are only for one Organization.

    Once you access the Organization, you will see the currently registered plugins. By default, only one is there, the Microsoft.Crm.ObjectModel assembly, that is used to call CRM 3.0 callouts.

    image

    Here you should Register the Assembly generated in the first step,

    image

    You select the assembly, and notice that the plugin should be displayed, that is because it's a plugin, if you have an assembly contain Workflow Actions, or multiple plugins, the will be all displayed.

    image

    Third the step registration

    Here is the more complex step, because it is not intuitive, there is no drop down for the possible values.

    • The message is the message that will trigger the plugin.

    image

    • The primary entity is the entity that will trigger the plugin.

    image

    • The secondary entity is only when the plugin should be fired for an event requiring two entity, like the Set Related Message. Here it is not required.
    • Filtering Attributes, set the attributes that will fire the plugin, defaulted to all.

    image

    • The plugin should be automatically filed.
    • The Description is generated.
    • The User's context is in the case that the plugin is doing something that the current user do not have the right to do. (If you want to control some part of CRM)
    • Execution Order should be changed to priories steps.
    • In the stage of execution you should select if the plugin is executed "after or before the main operation, outside the transaction."
    • Execution mode for asynchronous or synchronous operation
    • The triggering pipeline is a little more complex, but the general rule, according to the SDK is "If you want your plug-in to run regardless of whether a Web service call or an (internal) platform call initiated the pipeline, register your plug-in in a child pipeline. "
    • Server and offline, if you want the plugin to be deployed on the server and or on the offline client (outlook).
    • Secure Configuration, or unsecureconfiguration, those are passed to the plugin's constructor. The only difference is the visibility, everybody can see the first, but only user's with the PrvRead on this entity can view the second. Those are not encrypted.

    Fourth, the image registration

    In this example, we do not need images, but this is required when we want more than the given.

    image

    After restarting the Asynchronous service, you are done!

    -f.

    Tags:

    Development

    Version 2 of the Plugin Registration Tool

    by support 25. February 2008 19:21

    A very nice interface, all functionality in it, Export & Import and open source!

    http://blogs.msdn.com/crm/archive/2008/02/04/crm-registering-plug-ins-made-easy.aspx

    -f.

    Tags:

    Development

    When It's the time to create more than a simple workflow

    by support 25. February 2008 10:59

    There is a post that describes how to create a Custom Workflow and use it in Microsoft CRM 4.0

    http://blogs.msdn.com/jonasd/archive/2008/01/21/Creating-a-no_2D00_code-workflow-for-CRM-4.0-with-Visual-Studio-2005-_2800_2008_2900_.aspx

    -f.

    Tags:

    Development