Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Make Notes Mandatory

(0) ShareShare
ReportReport
Posted on by

Hi experts , 
I am asking how can make notes section mandatory in service activity form in CRM 2015 ?

*This post is locked for comments

  • Verified answer
    gdas Profile Picture
    50,091 Moderator on at
    RE: Make Notes Mandatory

    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");

               }

           }

       }

    }

  • RaviKashyap Profile Picture
    55,410 Moderator on at
    RE: Make Notes Mandatory

    Hi Martina,

    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.

  • Suggested answer
    ashlega Profile Picture
    34,477 on at
    RE: Make Notes Mandatory

    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.

  • Suggested answer
    TheMarkChristie Profile Picture
    10,328 Moderator on at
    RE: Make Notes Mandatory

    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

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Kudos to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Microsoft Dynamics CRM (Archived)

#1
Mohamed Amine Mahmoudi Profile Picture

Mohamed Amine Mahmoudi 83 Super User 2025 Season 1

#2
Community Member Profile Picture

Community Member 52

#3
Victor Onyebuchi Profile Picture

Victor Onyebuchi 6

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans