Hot answers tagged

16

Well let's take a look at your deploystage directory So, this is really interesting. There are two things that pop out right away. Firstly, it looks like our package.xml file wasn't set up correctly to begin with. The following section: <types> <members>Site_Com_Access</members> <name>PermissionSet</name> </types&...


16

As of Summer 14, there are 2 new objects which allow you to use SOQL to see which users are licensed for particular Managed Packages: PackageLicense and UserPackageLicense. UserPackageLicense lets you see which users are licensed for a particular package: String APP_NAMESPACE_PREFIX = 'skuid'; List<User> licensedUsers = [ SELECT Name FROM ...


16

You have to use the namespace to reference a component in a managed package. Just changing the code in the subscriber org should work. Here's the modified version you'd want to use (change packageNS as appropriate): packageNS.MyGlobalClass.doWork();


13

I have something similar in a package I have built - a series of apex classes that make callouts to a third party web service. The expectation is that a customer will then build their own VF controllers to utilize my classes, and the data they return. To get round the issue you raise, I built a globally available method in a class in my managed package that ...


12

Although this post is from last year, I would like to address it since it's apparently coming up in search results for those looking to post unmanaged packages to the AppExchange, and the main answer currently features out-of-date info. To confirm, unmanaged packages are not accepted for security review or posting on the AppExchange. I've put together some ...


11

You might also be interested in this Apex Enterprise pattern we presented at Dreamforce this year. If you follow the Selector pattern to manage your database query code. It automatically handles multi-currency for you in the SObjectSelector base class. Useful to ensure during your development process no hard references slip into your queries without you ...


11

Your right James, you need to use dynamic SOQL and to test the org for a presents of multi-currency related fields. For example, wrap your methods that reference multi-currency objects in a check for an element that is only available in orgs that have multi-currency enabled (I'm using DatedConversionRate here, but there might be a schema type that is more ...


10

Does your post install script have with sharing in the class definition? If it does, try removing it or changing to without sharing. There may be an issue with the user that the post install script is running as not being able to access the custom object when sharing rules are enforced.


10

I'm pretty familiar with the Metadata API and deletion of Package 'definitions' is not supported presently it appears. The only thing i can think is accessing the Delete action via the page URL's, which is not ideal of course since its not supported. I did also try this in destructiveChanges.xml, it did not work sadly. I should clarify, it did not error, ...


9

There are already some open sourced tools for this task .One of them is as below https://packagebuilder.herokuapp.com/ You can also use eclipse to the do this .In eclipse once you selected compoenents and fetch the package xml file is formed .


8

A custom app in Salesforce is not the same thing as an AppExchange app. A custom app is: An “app” is a group of tabs that works as a unit to provide application functionality. Salesforce provides standard apps such as Sales and Call Center. You can customize the standard apps to match the way you work. So, essentially, a custom app is just a ...


8

Go to Setup > Customize > Home > Custom Links Create a new custom link to your VF page (eg /apex/ns__pageName) Edit your package and specify the custom link Now a [Configure] button will appear after install. Guide your users to click it.


8

Update Salesforce does not allow unmanaged packages to be part of appexchange .You will have to convert them to managed packages . You can publish your apps as managed package to the appexchange provided you sign up as partner.Do not confuse that partner has to be some consulting firm .Anyone can be a partner Even as a solo developer you can be a part of ...


8

It cannot currently be done by you. Perhaps Salesforce support could do it if you contacted them. You can uninstall the package from various orgs as suggested by the previous answer. That does not eliminate the package from your package list. sfdx force:package:list ... will still show the package even if it is uninstalled from all orgs. I have created ...


8

One viable alternative is start converting the profiles into permission sets as a part of the DX move . With permission set you can easily group them with relevant objects . Salesforce did a blogpost on this and you might find the blog helpful. https://developer.salesforce.com/blogs/2018/12/migrating-to-permission-sets-for-dx.html


7

I have never tried this before. But using dynamic objects you can do this. Here are idea to get you started. Store the package details and object, field in some custom setting or custom label. Now make a dynamic SOQL to query package details. If you found the details then create dynamic instance of sObject and create new record of it. As you are not direct ...


6

Once you have a managed package you will know the Org id of your packaging org (and that's never going to change). In your code you could check the Org Id using UserInfo.getOrganizationId() against the packaging org id (hard-coded) (1) the namespace will be present, but the org id will not be the same as the packaging org id (2) the namespace will be ...


6

No, you can't dynamically create schema with a package. You would need to either include all fields and "feature" them selectively in different configurations or have different packages. EDIT: Have you considered a package with a base schema, that is needed in all configurations? Then you have a series of other packages which extend your base package and ...


6

When you run this code in your original environment, it's finding the RecordType that you had manually created in that org. You'd get the same result both running the test and running the code in the console. Packaging and deploying to a fresh organization without that RecordType fails if it hasn't been included in the package or manually created beforehand....


6

Here is what you need to do: You need the ability to fetch the metadata details from the org. If you want to do this in Apex, you might want to check out the Apex Wrapper Salesforce Metadata API. You could use the Salesforce REST APIs for Metadata and do this in javascript example (by creating a chrome extension?). You can check out the source code of ...


6

There are certain situations where Salesforce will not allow you to uninstall a package because it could interfere with a part of the system that is not being deleted. I've list a few scenarios straight from Salesforce, where an uninstall option is not available. -You can’t uninstall a package whenever any component in the package is referenced by a ...


6

I believe there is a case where a package does not have an uninstall link which has nothing to do with dependencies. If the package is a subscription from the AppExchange, I believe you have to cancel the subscription in the checkout page before you can uninstall. Navigate to the Salesforce AppExchange website: https://appexchange.salesforce.com/ Login ...


6

Take a look at An Introduction to Packaging: Implications of Managed Packages on Source Code If someone installs a managed package, they don't get access to all the source code of that package. For example, if the package installs an Apex class, they will not be able to view the source code of that Apex class. Here is a list of factors that should be ...


6

When creating a managed package, prior to uploading you need to have test methods that meet the 75% coverage while in the packaging org. If they pass the managed package can be created So the answer is yes When installing in the destination org the tests are not run and are not required or expected to pass since configuration in destination orgs vary.


6

Don't worry about coding defensively against your client's configuration; they're allowed to ignore certain types of test failures. This is noted in the documentation: If a subscriber creates a validation rule, required field, or trigger on an object referenced by your package, your test might fail if it performs DML on this object. If this object is ...


6

This is a known issue and we have an item in our roadmap to fix this so that apex code in namespaced unlocked packages is visible in installed orgs. The side effect of this is that it is difficult to work with debug logs in this scenario. My suggestion is to explore (until we fix this) no-namespace unlocked packages. In a no-namespace unlocked package, Apex ...


6

Where do you actually create the package for the shared classes? I created it in a scratch org like the docs said. But what happens when the scratch org is deleted due to expiration Packages are created in the DevHub org, so they won't be deleted with a scratch org. I cannot promote the package version as it says I do not have the required permissions. ...


6

Generally, is it possible to install two unlocked packages that share overlapping Metadata, e.g. the same custom object? One would need to be a dependent of the other if the exact same metadata exists. Note, however, that a custom object has many related components, which of which may be unique. For example, you might have a custom object, and a dependent ...


6

On our product roadmap, we have plans to support installing and upgrading multiple packages in a single transaction. Until that is available, would this multi-step process work for you? 1) Release Package A ver 1.1.0 that has both the methods - global static void doFoo() and global static void doFoo(String msg). 2) Release Package B ver 1.1.0 where doBar(...


5

I'm also a consultant. We don't see a need to mess with the Ant tool or any of that nonsense. We utilize MavensMate and Sublime Text 3 along with the sourceTree or the git client of your choice. MavensMate handles the local <--> sfdc connection and git takes care of the rest. If you're not set on a fancy gui for git you can even do everything inside ...


Only top voted, non community-wiki answers of a minimum length are eligible