I'm using the major push upgrades to install a new version of my managed package in our customer.

In this package I have a new field and it didn't exist in an older version of the package. In the postInstall script I'm trying to populate this field. Then I got the error: "Field is not writeable".

How can I solve it? I already setted a permission set for all the users giving access to the field, but the postInstall script is executed with another user.

  • 2
    Can you post some more details? Some code, and some more info on the field you are attempting to write to, would help. AFAIK there is no general issue with post-install scripts and new custom fields, I've done what you describe several times.
    – jkraybill
    Commented Jun 17, 2013 at 3:33
  • It's working now! There still was a with sharing in a class called by the PostInstall script. Thanks. Commented Jun 19, 2013 at 14:29
  • 1
    Hopefully PJC's post will get undeleted, and when it does, please accept his answer instead of your own since he got it right immediately :)
    – jkraybill
    Commented Jun 20, 2013 at 2:48
  • 1
    I did an undelete.
    – pjcarly
    Commented Jun 20, 2013 at 7:12

2 Answers 2


Try adding

without sharing to your postinstall class

  • It didn't work. I got the same error. Thanks anyway. Commented Jun 14, 2013 at 18:50

I was using the with sharing key in a class called by the PostInstall Script.

I have changed it for without sharing so it doesn't consider the sharing rules for the execution.

  • It looks like PJC proposed this on the 14th, is there a reason you didn't accept his answer? Commented Jun 20, 2013 at 11:24

You must log in to answer this question.

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