function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Donal Morrissey 3Donal Morrissey 3 

Required task fields not enforced in lightning

Why can I save a Task in Lightning without having to populate some/all of the required fields?
ShivankurShivankur (Salesforce Developers) 
Hi Donal,

Tasks can be created through apex, visual flows, process builder, and of course through the api. When creating a new Task, you will need to include all required fields from the Task object.

Currently, the required fields are Subject, OwnerId, Status, and WhatId. The Subject field is the name of the Task, the WhatId is the object the task is associated with, and finally, OwnerId is the person that will do the Task.

Please check out the object reference documentation to understand more about this object in Salesforce:
https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_task.htm

Hope above information helps. Please mark as Best Answer so that it can help others in future.

Thanks.
mukesh guptamukesh gupta
Hi Donal,

Yes,  Required  fields not enforced in lightning

You can use required="true" if you want to make any field required in the Lightning component.

if you need any assistanse, Please let me know!!

Kindly mark my solution as the best answer if it helps you.

Thanks
Mukesh