Skip to main content

Notifications

Microsoft Dynamics CRM (Archived)

Make a contact not editable

Posted on by Microsoft Employee

Hi All,

My company configured a generic Contact used as Default when  a specific field during company setup cannot be specified at the creation.

Now we are experiencing problems where people edit this generic contact instead of creating a new one once the person to be configured in the field above have been specify at business level.

I have been asked if Is possible to lock this generic contact so that nobody can edit it. I have google it for a while but cannot fine any answer for this. I have been able to find staff about security field level but it looks that configuring that will do it for all contact why I need this on a single contact.

Is this something feasible?

Thanks

Regards

Federico

*This post is locked for comments

  • Tim Dutcher Profile Picture
    Tim Dutcher 2,100 on at
    RE: Make a contact not editable

    That would be too quick and easy, Scott.  :)

  • ScottDurow Profile Picture
    ScottDurow 50,177 on at
    RE: Make a contact not editable

    Perhaps rather than use a plugin -you could simply create an sync workflow that tests for the name of the contact and then uses the stop with error to display the message to the user.

  • Verified answer
    Tim Dutcher Profile Picture
    Tim Dutcher 2,100 on at
    RE: Make a contact not editable

    I've also worked on CRM systems where it was necessary to protect a fixed record. For example, a client had an account named "UNASSIGNED" and they related unknown contacts to that account. They did not want anyone to change anything about that fixed account record.

    If you only protect the record using client-side code then it's still possible for someone to update the record during a bulk update, Excel-based update, etc.

    If you also want to protect the record server-side, then you can create a simple plug-in. Sample code is below:

    // Register the plug-in on update of contact, pre-operation, synchronous.
    // Register a pre-image that gives you "fullname".

    Entity preImageEntity = (Entity)context.PreEntityImages["YOUR_PREIMAGE_NAME_HERE"];
    if (preImageEntity.GetAttributeValue<string>("fullname") == "YOUR_FIXED_CONTACT_NAME_HERE")
    {
       throw new InvalidPluginExecutionException("This contact cannot be modified.");
    }
     

  • Suggested answer
    Drew Poggemann Profile Picture
    Drew Poggemann 9,079 on at
    RE: Make a contact not editable

    The other options above are logical and will help to disable fields on a form but I would suggest to create a custom entity for this type of information and do not allow anyone to modify that entity.  You can then relate this to to customer or pull information from this entity on to the customer when it is created as default data.  

    Thanks much,  

  • Verified answer
    TheMarkChristie Profile Picture
    TheMarkChristie 10,328 on at
    RE: Make a contact not editable

    Hi

    You could make a business rule to say that if "Contact Name" = Generic User 123

    Set Fields (All on form) to Locked

  • Verified answer
    Kumar Viju Profile Picture
    Kumar Viju 1,026 on at
    RE: Make a contact not editable

    Hi,

    The quickest way is use a JavaScript. Create a On Load Function and Check for Some Keyword. Ex:

    If ( Contact Name = "XYZ")

    {

     Disable All Fields on the Form

    }

    Refer:

    community.dynamics.com/.../189988

    stackoverflow.com/.../disabling-all-fields-on-a-form-in-crm-2015

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,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans