web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Pages / Make Notes Mandatory
Power Pages
Unanswered

Make Notes Mandatory

(0) ShareShare
ReportReport
Posted on by 62

Hi All,

 

We are using CRM form notes in the Portal Entity/Web forms 

We have a requirement make Notes section mandatory 

Could you please help me with the same

 

Thanks,

Categories:
I have the same question (0)
  • v-qiaqi@microsoft.com Profile Picture
    on at

    Hi @SunilR,

    Based on the issue that you mentioned, do you want to make Notes section mandatory in the portal?

    Could you please share a bit more about the scenario?

    Actually, making the Notes section mandatory is not that easy like it sounds like, I suggest you could create a separate field on the entity itself to store notes and then use the workflow to update notes.

    You can go for this because it's best practice to do through workflow instead of writing plugin.

    If you insist on a plugin, as an alternate options, 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");
    
     }
    
     }
    
     }
    
    }

    Check if it could help.

    Regards,

    Qi

  • SuneelReddy Profile Picture
    62 on at

    Thanks for the reply

     

    I need to make notes section mandatory in  Portals forms not in the CRM.

    Control is CRM notes section on the portal forms.

  • ragavanrajan Profile Picture
    7,044 Most Valuable Professional on at

    Hi @SunilR , 

     

          As @v-qiaqi-msft it is not that easy. But you can definitely enable it. If you are using entity form or web form you can try the following official docs which will work

     

    https://docs.microsoft.com/en-us/powerapps/maker/portals/configure-notes 

     

    Hope it helps. 

    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

  • SuneelReddy Profile Picture
    62 on at

    @ragavanrajan  I want to make it note section mandatory.

  • ragavanrajan Profile Picture
    7,044 Most Valuable Professional on at

    Hi @SunilR

     

     Please check the following thread. if you prefer jQuery then you can check the following thread for implementation 

     

    https://community.dynamics.com/crm/f/microsoft-dynamics-crm-forum/258806/can-i-make-attachment-mandatory/726498#:~:text=Yes%20you%20can%20make%20notes%20attachment%20as%20mandatory.,-function%20CheckNote() 

     

    You can also try this logic add one more boolean field in your entity and hide this field in the form. If the attachment is attached then you can mark your custom field as Yes and allow them to submit it by using little jquery or vanilla javascript logic with the combination of CSS. 

     

    ------------

     

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

  • Community Power Platform Member Profile Picture
    on at

    Hi, You can try this example below 

    https://www.spyglassmtg.com/blog/power-apps-portal-advanced-forms-web-forms-and-custom-javascript

     

    Thanks,

  • oliver.rodrigues Profile Picture
    9,368 Most Valuable Professional on at

    hi @SunilR have you tried the suggestions above?

     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Pages

#1
Jerry-IN Profile Picture

Jerry-IN 71

#2
Fubar Profile Picture

Fubar 62 Super User 2025 Season 2

#3
sannavajjala87 Profile Picture

sannavajjala87 31

Last 30 days Overall leaderboard