Archives / 2016 / January
  • Plugin Images (Pre and Post)

    PreEntityImages and PostEntityImages contain snapshots of the primary entity's attributes before (pre) and after (post) the core platform operation. Microsoft Dynamics CRM populates the pre-entity and post-entity images based on the security privileges of the impersonated system user. Only entity attributes that are set to a value or are null are available in the pre or post entity images. You can specify to have the platform populate these PreEntityImages and PostEntityImages properties when you register your plug-in. The entity alias value you specify during plug-in registration is used as the key into the image collection in your plug-in code.

    Example of PreEntityimage plugin and PostEntityimage plugin:

    Let’s take one scenario, update primary contact address fields into account address fields. I added address2 fields into account entity for understand both image operations, save and publish it. Here address1 fields updating are given in post image, address2 fields updating are given in preimage plugin………..

    Go to Visual Studio>new project>visual C#>class Library and then give name of the solution >click ok.


    Next follow the below steps:

    Step-1: Add minimum required references:

    System. Security





    Step-2: Extend the class from Microsoft.Xrm.Sdk.Iplugin.

    Step-3: Write your code.


    Code: Entity preimage = (Entity) context.PreEntityImages ["preupdateimage"];

    Entity postimage = (Entity) context.PostEntityImages ["postupdateimage"];

    These two lines are required for plugin image operations.

    Go to solution explorer, Right click on project (preimageplugin1) and then double click on properties.


    Go to Signing, mark Sign the assembly check box. This is required in order to be able to deploy the plugin.


    1. Compile the assembly and deploy using Plugin Registration Tool. Go to plugin registration tool and then click on create new connection, give credentials of your CRM then click on login button.


    2. Follow the below steps.

    a) Click on Register button.

    b) Select new Register assembly.

    c) Specify location of the assembly.

    d) Mark Select All check box.

    e) Click on Register selected plugins button.


    3. Next follow the steps

    1) Click on Register button.

    2) Select Register new step.

    3) Give the message name as we have to perform (update), and select primary entity (account)as we have to perform on it, select field name (primarycontactid)as operation performed when the selected field change.

    4) Click on Register new step button.


    4. Next follow the steps.

    1) Click on Register button.

    2) Select Register new image.

    3) Select image type preimage.

    4) Give preimage name Entity Alias (which name is mentioned in code that given it).

    5) Click on Register image button.


    5. Create on more image step for postimage

    1) Click on Register button.

    2) Select Register new image.

    3) Select image type postimage.

    4) Give preimage name Entity Alias (which name is mentioned in code that given it).

    5) Click on Register image button.



    Finally go to CRM for check the output, open account records, select any one record, and change the primary entity name observe the output.

    See the below and observe before change the primarycontactid


    See the below and observe after change the primarycontactid.


  • MTC Empowers women In Engineering Technology

    Major tech companies release annual information on the racial and gender make-up of their employees. As these ‘diversity reports’ are released, we will keep updating this interactive blog to see how tech companies compare in terms of gender and race in their custom-defined 'technology' and 'leadership' positions.


    In a surprise move recently, several technology giants reported their diversity or lack of statistics after years of resistance. The numbers very clearly indicate a homogenised workforce within tech and the problems that under-represented groups – women, racial minorities and veterans face. A handy graphic by the Wall Street Journal contains the percentage of women in technical and leadership roles in these companies:

    Moving beyond STEM, data from the S&P 500 companies show the numbers are disappointing there as well. Only 23companies on the list have women CEOs, representing a mere 4.6%. Women occupy 19.2% of the board seats of these companies and 25.1% of executive and senior level management positions. These numbers are very low and are improving at a glacial pace.

    Meanwhile, the number of new technical jobs in India is rising every year, and there’s already a reported shortage of 500,000skilled workers. Companies in the science and tech domain are hurting from this skills gap and are unable to hire and retain enough skilled employees to support the business.

    On one hand there is the skills gap; on the other hand, many women leave their jobs midway because of reasons that have nothing to do with their waning interest in science and tech: lesser pay than their male peers, bias and discrimination in the workplace, being discriminated against when they have children, and so on. A logical solution to solve the skills gap is to include and retain the larger population – women and other under-represented groups – as quickly as possible. Companies that hire and retain more women gain two important advantages: first, they have a better shot at solving the huge skills gap problem.

    Second, they gain an edge in the job market by creating a more welcoming culture which automatically attracts more skilled labour in the form of women graduating from technical colleges looking for a good company they can work in. In an age where discriminatory workplace practices are deterring many women from considering B.Technology, companies like MTC initiative to hire more women ensure that we make diversity in culture a priority can cause a paradigm shift in making their company more appealing to join.

    Many studies have shown that companies with diverse workforces have shown to perform better. A diverse culture is more representative of the real world. Potential employees today are looking to join companies where they can develop holistically, and diversity in culture enables that. Companies like MTC make this a priority can gain a competitive edge in their efforts to hire and retain technical workers who are motivated to stay and give the job their best. Possibly removing hindrances that keep qualified women from rising to the ranks of leadership, MTC is proud in its position of having a third of its workforce as women now.

Please Wait