Skip to main content

Notifications

Microsoft Dynamics CRM (Archived)

Not able to update a locked field by plugin

Posted on by 435

Hi 

I am trying to  update a field which is added in form .

It is showing locked symbol.

I am trying to update this field by plugin but it is not working. 

Please suggest.

*This post is locked for comments

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Not able to update a locked field by plugin

    oh.. although the reply might come too late, but you can use this to update a locked field

    Xrm.Page.getAttribute("xxx").setSubmitMode("always");

  • windyMill Profile Picture
    windyMill 435 on at
    RE: Not able to update a locked field by plugin

    I got the answer a javascript at form load was locking the field. I removed it then its working fine.

    Thank you all

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Not able to update a locked field by plugin

    Quick way of doing it is via the PRE operation plugins, PRE-create, PRE-update etc.

    var target = context.TargetImage;

    target[FIELDNAME] = VALUE;

  • Leonardo Mizikami Profile Picture
    Leonardo Mizikami 150 on at
    RE: Not able to update a locked field by plugin

    If the plugin step is registred in post operation, make sure you are updating the entity.

    If it is not the case, any exception was thrown? Can you share the source code?

  • David Jennaway Profile Picture
    David Jennaway 14,063 on at
    RE: Not able to update a locked field by plugin

    What happens when you try an update the field in the plugin code ? Do you get an error ?

    Is this a custom field, or a system field ? Some system fields cannot be updated - these have ValidForUpdate = false in the metadata

  • a33ik Profile Picture
    a33ik 84,323 Most Valuable Professional on at
    RE: Not able to update a locked field by plugin

    Hello,

    Can you please provide code of your plugin and screenshot how you registered your plugin?

  • Thomas David Dayman Profile Picture
    Thomas David Dayman 11,323 on at
    RE: Not able to update a locked field by plugin

    Could you show us some of your code?

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!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans