Let's say I have created a major package 1.2.0 and have added some new functionality with new components. I also have a package with version 1.1.6 without the new components and functionality. For some reason now if I want to create a patch (without new components and code) for 1.1 package that is 1.1.7 is that doable ? IS that allowed in Salesforce ? Can I use the 1.1 patch development org to create a new patch ?
1 Answer
Patch versions are created in a copy of the original packaging org. See e.g. Working with Patch Versions.
The changes you can make in a patch are quite limited e.g. fixing some lines of code in an existing Apex class. In general you cannot add new components. See Create and Upload Patches that lists:
- You can’t add package components.
- You can’t delete existing package components.
- API and dynamic Apex access controls can’t change for the package.
- No deprecation of any Apex code.
- You can’t add new Apex class relationships, such as extends.
- You can’t add Apex access modifiers, such as virtual or global.
- You can’t add new web services.
- You can’t add feature dependencies.
One way to think about this is that your 1.1.6 package (by Salesforce's design) must remain upgradeable to 1.2.0, and if you add a new component such as an SObject field that isn't present in 1.2.0 then the upgrade won't be possible (as API would effectively be being removed).
-
Makes sense. but then is that not permitted at all or I can create a patch if i am not adding or removing any component ? As in what if I create a patch 1.1.6 just with a code change so that it is still upgradeable to 1.2.0 ?– Yogesh DMay 15, 2018 at 19:45
-
1@y.dixit You can patch any previous version. For your example, if you have a 1.1.6 then there is already a patch org (that you will have to find) and you can add another change on top of the previous ones to create a 1.1.7. (It's just one line of change.) We have various past releases patched at various times - it's quite an open mechanism.– Keith CMay 15, 2018 at 19:53
-
Perfect. I think this is not something recommended or best practice but sometimes can be a need of hour when someone needs to hofix some bug on the previous version patch that client is currently on. Cause sometimes clients are reluctant to update to a newer major version package.– Yogesh DMay 16, 2018 at 15:06