Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Update a field based on another field in CRM 365

Posted on by 475

Hi guys,

I am new to CRM and I want to update a field based on another field in the same entity but I am unable to do that.

Please advise on this.

Any help on this would be appreciated.

Regards,

Bharath

*This post is locked for comments

  • Suggested answer
    Sreevalli Profile Picture
    Sreevalli 3,256 on at
    RE: Update a field based on another field in CRM 365

    Hi,

    Plugin will never update only one field from your attribute collection, it updates all or null. if so, then you must be checking wrong field. try to add the fields in advance find and check.

  • a33ik Profile Picture
    a33ik 84,323 Most Valuable Professional on at
    RE: Update a field based on another field in CRM 365

    When changes are applied to Target from InputParameters this causes the update.

  • Martin Donnelly Profile Picture
    Martin Donnelly 1,010 on at
    RE: Update a field based on another field in CRM 365

    True if one is changing the target image, right?

  • Suggested answer
    a33ik Profile Picture
    a33ik 84,323 Most Valuable Professional on at
    RE: Update a field based on another field in CRM 365

    Martin,

    That's not absolutely correct. If plugin is executed in pre-mode there is no need to call update.

  • Martin Donnelly Profile Picture
    Martin Donnelly 1,010 on at
    RE: Update a field based on another field in CRM 365

    The entity is in memory not in the database.  You have set the Attribute values in memory, but this still requires you send the entity in on an update request.  You have an update request farther down in your code?

  • Suggested answer
    a33ik Profile Picture
    a33ik 84,323 Most Valuable Professional on at
    RE: Update a field based on another field in CRM 365

    If you use plugin can you please provide full code and screenshot that demonstrates your plugin registration options and how you initiate triggering of plugin?

  • bharathkarunakaran Profile Picture
    bharathkarunakaran 475 on at
    RE: Update a field based on another field in CRM 365
    if (entity.LogicalName == "account")
                    {
                        try
                        {
                            //var telephone = entity.Attributes["numberofemployees"];
                            // if (entity.Attributes.Contains["name"]=="test")// = "test";
                            {
                                entity.Attributes["name"] = "test";
                                entity.Attributes["telephone1"] = "7094351653";
                                
                            }
                           
    
                        }


    Hi,

    I tried on the server side and create a plugin to update the account value to test and phone number to hardcore number for a practice.

    but what I get is I am able to update the account name but can't able to update the phone number.

    Please advise on this.

    Regards,

    Bharath K

  • Suggested answer
    a33ik Profile Picture
    a33ik 84,323 Most Valuable Professional on at
    RE: Update a field based on another field in CRM 365

    Hello Bharath,

    Can you share what did you try? Is it client-side or server-side. It would be great if you can provide full scenario.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans