cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
SunilR
Helper I
Helper I

Make Notes Mandatory

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,

7 REPLIES 7
v-qiaqi-msft
Community Support
Community Support

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

Best Regards,
Qi

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
Super User
Super User

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.

@ragavanrajan  I want to make it note section mandatory.

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-manda... 

 

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.

Sal
Helper III
Helper III

OliverRodrigues
Super User II
Super User II

hi @SunilR have you tried the suggestions above?

 




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.

Power Apps Portals Super User


Oliver Rodrigues


 

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (3,163)