0

We have a checkbox custom field on Account that defaults to false. It's part of a managed package that we provide. Because it is in a managed package, our customers who install the package can't change the default value themselves directly.

We'd like our customers to be able to change the default value of the field to true if they wish.

Is it possible to programatically change the checkbox field default value via Apex? Or to make the default value editable even though its in a managed package? Is there any other way to achieve this functionality?

Update: If possible, we'd like to avoid achieving this with a Trigger/Workflow Rule on Account creation, because it will look to the user on the New Account page like we are setting the field False but in fact it will be created as True.

2

I think there are more than few ways to achieve that goal... First of all you can make a simple WF Rule that on each create update the field = True. A Trigger can also be written if needed to set it as True and if you want to control when should the Trigger run in each Org you can add Custom Setting which can set the Criteria as you want..

| improve this answer | |
  • Thanks Yuval. In both of these options, if a user is creating a new Account, they will see the checkbox as unticked on the New Account screen but then it will be ticked on create, right? This could be confusing for users so if I can have the checkbox set correctly on the New Account screen it would be ideal. – sheilak Jul 29 '15 at 20:30
  • 1
    Well If you need it in Layout and not just the Value... I guess another approach can be to create a New field which is turn by default On and to WF field update your current field with the opposite Value which I guess you have some logic on it... – sfdx bomb Jul 29 '15 at 21:11
  • Thanks, probably I'll go with simple WF or Trigger for now. I've also voted on this related idea on IdeaExchange – sheilak Jul 30 '15 at 16:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.