3

I would like to programmatically create an unmanaged package for a customer to install; the package needs to be programmatically created because its content is based some configurations specific to the customer (for example, each customer might have a different set of custom fields depending on the configurations). I know I could do this via the Metadata API, but would rather not have to require the Modify All Data permission for my user. Instead, it'd be nice if I can just generate a package which the customer Salesforce admin can then install manually by following a link.

Is that possible?

(FYI, this is another attempt to find a solution for this)

3

There is no actual API for uploading packages automatically. You can create packages using code via the Metadata API, but there's no mechanism for uploading these packages. It would be conceptually possible to emulate a browser and carry out the necessary steps to upload the package, but it would be more of a "hack" than any officially supported method. For example, a developer could use the Selenium testing tools, controlled by a Java program to select the required fields, then have Selenium perform the required clicks to upload the package. However, like all screen-scraping solutions, this could break at any time, because it is not an official API. You could be better off creating many packages, upload each of them, then give the customers whichever package(s) they need.

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.