I'm developing the managed package, which contains some extended lwc form for new account creation.

Reassign "new" button on account object is manual operation (after managed package instalation): enter image description here During testing in scratch org, I have found, that after the uninstalling my package, I cant reassign "new" button behavior, and see an error: acc buttons edit I want to use apex UninstallScript class, to check "new account button" behavior.

My questions:

  1. Is there a way to check behavior of standard new account button by apex code?
  2. Is there a way to delete override of standard new account button by apex code?
  3. Is there a way to stop uninstall the managed package process with an error message?
  4. Is there some another way to solve my problem? May be some best practises?

1 Answer 1


This configurations could be changed using Metadata API, not native apex, so 1 and 2 answer is no.

You can use metadata API to deploy those action override for Account

<CustomObject xmlns="http://soap.sforce.com/2006/04/metadata">

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .