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
Karthik jKarthik j 

How to set Field level security using Apex code

Hi all

I am having a scenario where I want to give edit access for ownerId field of task object to one profile using apex code. Can anyone please help me out here.

Thanks.
ravi soniravi soni
hi Karthik,
you can't give Fls from apex. you need to follow manual access.
You can create a permission set and assign permission set to praticular user or create a new profile.
Above info is useful to you then don't forget to mark it as best answer.
Thank you