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
That would be too quick and easy, Scott. :)
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.
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.");
}
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,
Hi
You could make a business rule to say that if "Contact Name" = Generic User 123
Set Fields (All on form) to Locked
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
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,253 Super User 2024 Season 2
Martin Dráb 230,188 Most Valuable Professional
nmaenpaa 101,156