+ Start a Discussion
Shanmu P 6Shanmu P 6 

How to add a custom checkbox in "New User" creation page using Apex ?

In my app, I want to have a trigger after user creation. That trigger has to be based on custom checkbox in "New User" creation page. How to create this cutom checkbox in "New user" creation page using apex ?
Gaurish Gopal GoelGaurish Gopal Goel
Hi Shanmu,

You can create a custom field of Checkbox type on User object. Then write your apex trigger on User object and check if that field is checked or not. If the checkbox field value is True then write your logic otherwise do nothing. Please let me know if you want the trigger code.

If this answer solves your problem then mark it as the solution to help others. Thanks.
Shanmu P 6Shanmu P 6
Hi Gaurish,
My doubt is mainly , is it possible to create a custom checkbox field on User object using Apex? I mean programatically...
Gaurish Gopal GoelGaurish Gopal Goel
You will have to use Metadata API for that. Read this article for more info - http://www.gaurishgoel.com/2017/04/metadata-api.html