web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

How to update a field value when record is created for any entity?

(0) ShareShare
ReportReport
Posted on by

Hi,

I want to update a field value when record is created. I know it is possible using Process --> Workflow. But it is for specific entity. 

This process is for single entity.

Step-1: Create Process --> Workflow. Set it "Record is created".

0334.Workflow.png

Step-2: Using Plugin Registration Tool, add an assembly and add steps of "Create" and specify Entity.

7776.Workflow2.png

Above method is only work when record create for Account entity. I want to make it general. 

I want to call my code on create of record of any entity or the entities I select. I should also get context of record, so I can perform any action on record creation.

Can anybody please guide me how to achieve?

*This post is locked for comments

I have the same question (0)
  • Community Member Profile Picture
    on at
    RE: How to update a field value when record is created for any entity?

    Okay! Thank you.

    Let me see which one help me out here.

  • Verified answer
    Community Member Profile Picture
    on at
    RE: How to update a field value when record is created for any entity?

    Hi,

    As suggested by Prateek, you can write a plugin on create of entity record on pre-event which will avoid update call. In create call itself you can set the value for the respective attributes. You can a check if the entity contains that attribute or not. Register step for each required entity. Else you can also register this plugin with none entity which will execute for each and every entity in system and may hamper the performance.

    [If you find any helpful answer(s) of your question, please mark the answer(s) as verified answer(s).]

  • Community Member Profile Picture
    on at
    RE: How to update a field value when record is created for any entity?

    Sorry but I am bit confuse here. I know plugin. But even using plugin, I need to register for each entity. I don't want to register for each entity.

    Is there any other way or there is any other possibility using plugin or workflow?

    The main goal is to call plugin on create record of any entity of CRM solution.

    Please guide me.

  • Suggested answer
    prt33k Profile Picture
    6,907 on at
    RE: How to update a field value when record is created for any entity?

    You need to create workflow or plugin for all those entities on which Update is required. CRM doesnt provide a way to run a common code on all entities since every entity has a different structure.

    Since in your case I assume that there will be common set of field in all the entities - i think creating a plugin will be much better since you can register the same plugin on create event of multiple entity without duplicating the code.

    Register the plugin on pre-event - this will prevent the unnecessary Update call .

    Thanks,

    Prateek

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
Aric Levin - MVP Profile Picture

Aric Levin - MVP 2 Moderator

#2
MA-04060624-0 Profile Picture

MA-04060624-0 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans