Notifications
Announcements
No record found.
Hi experts , I am asking how can make notes section mandatory in service activity form in CRM 2015 ?
*This post is locked for comments
Hi Martina
This is not as simple as it sounds as notes (Annotations) is its own entity so therefore it is difficult to do so,
I would recommend that you create a Notes for this activity (multi line text) and make this mandatory - then on save have a workflow update the notes and clear the "Notes for this activity" field
Hi Martina,
notes section is not a "field", so you can't make it mandatory (you can't even create a note until you have created a service activity).
Maybe create a new field in the service activity entity, add it to the form, call it "notes", make it mandatory.
Use a workflow to create an actual note based on the input in that new field.
Then use javascript to hide that new field on those service activities where the field has already been populated (if you want to be using notes section)
Users can still delete notes, so what is supposed to happen when the last note is deleted.. not sure about that - may need a plugin to do some extra validations.
As also suggested above, the best option would be do have a a separate field on the entity itself to store notes and then use the logic to add that note to the actual notes entity.
Hope this helps.
Hi Martina ,
Notes is an optional in ms dynamics CRM and its not a field.As Mark,Rabih,Alex here suggested to create new field and workflow to update notes.You can go for this because it's best practice to do through workflow instead of writing plugin.
However as an alternate options or if you have any existing plugin for this entity you can try to implements in plugin.
public class ValidateNote : IPlugin
{
public void Execute(IServiceProvider serviceProvider)
IPluginExecutionContext context = (IPluginExecutionContext)serviceProvider.GetService(typeof(IPluginExecutionContext));
IOrganizationServiceFactory serviceFactory = (IOrganizationServiceFactory)serviceProvider.GetService(typeof(IOrganizationServiceFactory));
IOrganizationService service = serviceFactory.CreateOrganizationService(context.UserId);
if (context.InputParameters.Contains("Target") && context.InputParameters["Target"] is Entity) {
Entity note = (Entity)context.InputParameters["Target"];
// you can also use "subject" instead of "description"
if (string.IsNullOrEmpty(note.GetAttributeValue<string>("description")) || string.IsNullOrEmpty(note.GetAttributeValue<string>("filename")))
throw new InvalidPluginExecutionException("Please add an attachment and description");
}
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.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
SA-08121319-0 4
Calum MacFarlane 4
Alex Fun Wei Jie 2