The Microsoft Dynamics CRM Platform Enhancement Discussion

  • How to Configure Buttons in D365 Portal Page?

    Based on your requirements, you can either use default buttons on Entity Forms and Entity Lists, or user defined buttons on D365 Portal.

    Products with Add to Cart Buttons

    1). In Portals, configure Entity Lists to show Products List in portal.

    2). In Entity Lists, use Grid Configuration section to configure buttons.

    3). Click Create Related Record and configure entity form which you are redirecting to and provide button label name Ex: Add to Cart.

    4). In Portals, when user clicks on Add to Cart button on products page, it will redirect him to carts form.

    Note: In Grid Configuration, View Actions and Item Actions are default buttons, you can use it as per your requirements.   

  • How to Trace a Plug-in? Isolation Mode in Plugins.

    To trace a Plug-in, we use Plug-in trace log which stores the trace log information.

    Enable Plug-in Trace Log:

    To enable the Plug-in Trace Log in CRM, navigate to Settings > Administration.

    The Administration window opens.

    Click System Settings. You will be directed to System Settings page.

    From here, you can navigate to the Customization tab and select all for the Enable logging to Plug-In Trace Log field. Then click OK.

    To check the Plug-in Trace Log entries, click on Main Settings Plug-in Trace Log.

    Isolation Mode in Plugins

    Isolation mode in plugins describes the level of security restrictions imposed on the plugin execution pipeline.

    Isolation mode is specified on assembly level and not on individual plugin steps.

    • If a plugin is in isolation mode, that means it set to be sandbox or none
    • CRM online plugins can only run with an isolation mode = sandbox
    • A normal plugin is a plugin which has an isolation mode = none
    • A plugin registered in sandbox mode is more secure, but some action are restricted, although a plugin can still access the Dynamics CRM organization service
    • Access to the file system,system event log, certain network protocols,registry, and some functionalities like using database or file directory is prevented in the sandbox. 

    For any help, write to us at salesteam@mtccrm.com

  • How to Execute Plugin Using JavaScript?

    There are many business scenarios where we are required to call a Plugin using JavaScript. In this blog, we will discuss one of the approaches that is very effective.

    To call Plugin using JavaScript, we should:

    • Create an action in CRM
    • Register Plugin
    • Register step on action message
    • Call this action in JavaScript

    Business Scenario:

    On Order entity we have a custom field, this field on change we trigger a plugin. Create an action, it is blank action with no arguments or steps. Activate that action and use that action name while registering step in plugin.

    Write the plugin code and register the plugin. In this scenario, we just have to write throw exception in code.

    Register New Step

    In step creation, we select message as action name (i.e., mtc_sendemaila49b5f8ca894e811) and we select primary entity as order and event pipeline stage as post-operation. Click on Register New Step.

    After completion of plugin registration, call your action in JavaScript code. Below code shows how to call action in JavaScript for your reference.

    We call above code (callAction function) during on change event in order entity. The below screenshot shows exception message in plugin.

    Still need any help? Write to us at salesteam@mtccrm.com. We will help you.

  • Things to Consider for Plug-in Deployment

    At the time of Plugin Assembly Registration, you can specify about Plug-in Deployment.

    • Firstly, you need to identify the deployment type i.e., CRM Online or CRM On-Premise.
      • For CRM Online, plug-in assemblies must be registered in Sandbox.
      • For CRM On-Premise, plug-in assemblies can be registered in Sandbox or outside the Sandbox (select radio box None).
    • If the isolation mode is Sandbox, the location is always Database, the advantage is that plug-ins stored in the database are automatically distributed across multiple CRM servers in a data center cluster.
    • The disadvantage is that you can't install external assemblies to the database, so if your plug-in uses an external assembly you need to merge it with your plugin assembly before the registration or deploy the external assembly manually to the GAC or the CRM bin folder.
    • If you register plugin assembly outside the Sandbox (i.e., CRM On-Premise), you can choose to deploy it to the GAC. In this case, the advantage is that you take full advantage of the GACs versioning system preventing conflicting versions of the same assembly, if multiple versions are needed. The disadvantage is that the registration requires gacutil.exe and this can be an issue for some deployments.
    • If you choose to deploy to Disk, the plug-in assembly will be copied to the CRM bin folder. In this case, the debug will be easier, but you will lose GAC versioning advantage that is available by deploying plug-in assembly in the database.

    Need help in CRM Plug-in Deployment? Talk to our CRM experts now. You can write to us at salesteam@mtccrm.com. 

  • What is Secure and Unsecure Plug-in Configuration?

    Microsoft Dynamics CRM provides two different configuration fields for plug-ins, namely Secure Configuration and Unsecure Configuration.

    Use Secure Configuration, when a setting is sensitive and shouldn’t be readable by any CRM user or if you don’t want that setting to be moved between environments while importing/exporting solutions.

    Secure configuration is only viewable by CRM Administrators while the Unsecure Configuration is viewable by any CRM user. Also, unsecure configuration will automatically move between environments with your CRM solutions while it is not the case in secure configuration.

    How to Handle Exceptions in Plug-ins?

    Handling exceptions means establishing alternate ways to continue the flow of a program.

    • The exception message for asynchronous registered plug-ins is written to a System Job.
    • For synchronous plug-ins, you can optionally display a custom error message in the error dialog of the web application by having your plug-in throw an InvalidPluginExecutionException with the custom message string as the exception Message property value.
    • For asynchronous plugins, no error is prompted to the user.
    • If there are any exceptions in plug-ins, the code will execute in database and the plugins will rollback. So, exception handling needs more attention.
    • In plug-in code, you need to place below lines of code to catch the exception thrown by plugins.

       catch (FaultException ex) 
       {

        throw new InvalidPluginExecutionException("Err occurred.", ex.Message);

       }

    • Plug-in trace log in Dynamics CRM, which made for debugging a plugin.
    • The Plug-in trace log feature saves trace log information with the advantage that trace log information will be available even when the plug-in doesn’t throw an exception

    Need help in CRM Plug-in Development? Talk to our CRM experts now. You can write to us at salesteam@mtccrm.com. 

Please Wait