Skip to main content

#Unlocked Packages0 utenti parlano di questo argomento

Win Lim ha fatto una domanda in #Appexchage Apps

Hi Community,

 

I am learning on Salesforce Unlocked Packages for developing an Internal application.

 

While going through the module  Unlocked Packages for Customers, I noticed that after a package version is created, anyone can install this unlocked package by using the Package Version Id.

 

The only protection mechanism available is only the installation key.

 

Since Unlocked Packages is being advocated for distributing internal applications on Salesforce, are there any additional measures that provide a more secure means of protecting the distribution of Unlocked Packages for internal usage?

 

Appreciate any advice on this.

Thank you!

 

Regards,

Win

 

#Appexchage Apps  #Unlocked Packages

 

#Security

 

#Package Installation

0/9000

Does anyone know an easy way to identify the org settings and features required for package components? And does anyone have general advice for troubleshooting package version create errors?

 

I've been trying to create an unlocked package with components that require custom campaign influence, and it took a long time for me to figure out that I needed to add the appropriate setting in my definition file (scratch org config file): "campaignSettings: {"enableCampaignInfluence2": true}.

 

I was able to create the first package version successfully, but now I'm getting errors on the version create again. The only thing I changed was adding reports and dashboards based on the CustomizableCampaignInfluence report type, which is a standard report type that gets generated when the custom campaign influence is enabled.

 

"ERROR running force:package:version:create: MultiTouchCampaignAttribution/Campaigns_Responses_Timeline_32e: ReportType: CustomizableCampaignInfluence is not available,MultiTouchCampaignAttribution/Revenue_by_Opportunity_Type_nhZ: ReportType: CustomizableCampaignInfluence is not available,MultiTouchAttributionDashboards/caDFoKVGnLTwriPidsJZVCMKlDyojs: In field: report - no Report named MultiTouchCampaignAttributionReports/Campaigns_Responses_Timeline_32e found,MultiTouchCampaignAttribution/Top_Campaigns_SB1: ReportType: CustomizableCampaignInfluence is not available"

 

Is there another org setting or feature I need to add to the definition file? I can't add this report type to the package because it's standard. I tried adding a custom report type that uses the campaign influence object instead, but that didn't work either.

 

I noticed that when I create a new scratch org with that config file, I can't access campaign influence records until I assign my user the Sales Cloud User or CRM user permision set. I tried including this in that config file,

 

"features": ["SalesUser"] 

 

but that just adds the Sales Cloud User permission set to the org, not assign it to my user. Maybe the package version create fails because no user in the scratch org can access the campaign influence object until that permission set is assigned. Do I need to create a script or something to automate the permission set assignment during the scratch org creation process?

2 commenti
  1. 12 mar 2025, 04:23

    Joe, there's a separate community group focused on unlocked packages.  I recommend hopping over there.  I've found great advice there.

0/9000

I've successfully released a Second Generation Unlocked Package that relies on two separate First Generation Managed Packages.

 

The Second Generation Unlocked Package and First Generation Managed Packages are in separate Developer Hubs. 

 

This dependancy has currently been defined using the 04t IDs for the 1GP Managed Package Versions. 

 

This means that when the 1GP Managed Packages are updated I'll also have to manually update the 2GP to rely on the new version. 

 

Is there are a better way to handle this? 

 

cc @Pronit Agrawal

 

#Unlocked Packages #Second Generation Packages #Package Dependency 

3 risposte
  1. 21 gen 2025, 14:16

    There is no automated way to do this but also remember that dependencies are a "minimum version" NOT an exact version. This means you only need to update your dependencies if you are changing your package to directly reference new features/metadata in the 1GP packages that a new to the 1GP package. You can leave you dependencies for a long time but still install the latest 1GP package versions and Salesforce will happily allow installing your 2GP as well.

0/9000

I've built a 2GP Package that I am trying to release as a Unlocked Package.

 

I've overcome various validation errors due to missing features or settings in my Scratch Org Definition file. 

 

However my package includes a Sharing Set which depends on the Contact being 'Private' and by default its 'Controlled by Parent', is there a way to define this feature/setting in my Scratch Org Definition File? 

 

@* Experience Cloud * @*Experience Cloud Developers* @Unlocked Packages  @Salesforce DX @* Salesforce Platform *

 

#Salesforce CLI #SFDX CLI #Salesforce Platform #Unlocked Packages #Unmanaged Package #Second Generation Packages #Scratch Org Definition #Experience Cloud #Experience Builder

2 risposte
  1. 4 dic 2024, 14:18

    @Tom Bassett this might help you - https://salesforce.stackexchange.com/questions/218183/sfdx-sharing-settings-scratch-orgs

     

    Is your package ultimately intended for public consumption, or are you just using it internally with your own org(s)?  Deploying sharing-related settings on standard objects can be tricky because the destination org may have valid reasons for how sharing is configured on their standard objects and can't change to support your package.

0/9000

Hi guys! I'm looking for someone with experience using the --upgrade-type flag who can clarify the meaning of the different options.

 

I've found documentation in two different places that says different things.

 

In the Salesforce CLI Command Reference:

  • DeprecateOnly: Mark all removed components as deprecated.
  • Mixed: Delete removed components, except for custom objects and custom fields, that don't have dependencies.
  • Delete: Delete all removed components that can be safely deleted, and deprecate the other components.

In the Salesforce DX Developer Guide:

  • Delete: specifies to delete all removed components, except for custom objects and custom fields, that don’t have dependencies.
  • DeprecateOnly: specifies that all removed components must be marked deprecated. The removed metadata exists in the target org after package upgrade, but is shown in the UI as deprecated from the package. This option is useful when migrating metadata from one package to another.
  • Mixed (the default): specifies that some removed components are deleted, and other components are marked deprecated. For more information on hard-deleted components, see Hard-Deleted Components in Unlocked Packages.

Mixed in the first and delete in the second have the same text. I understand that the mixed option works as described in the Salesforce DX Developer Guide taking into account the list of Hard-Deleted Components in Unlocked Packages, but I don't understand what the difference is with the delete option. What other metadata does this option delete that mixed doesn't?

 

#Unlocked Packages  #Metadata

0/9000

Hi guys! We wanted to include some custom fields and record types to Knowledge object (Knowledge__kav) to our namespaced unlocked package with intention to have the same functionality in 1GP managed package. Creating a version was ok, but when we tried to install it, the errors were thrown.

 

In case we included in the package only fields and record types folders under objects/Knowledge__kav folder, the following errors showed:

1. (Learning__c.Knowledge__c) referenceTo value of 'Knowledge__kav' does not resolve to a valid sObject type

Learning__c.Knowledge__c: referenceTo value of 'Knowledge__kav' does not resolve to a valid sObject type

 

2. (Knowledge__kav.Type__c) Entity not available

The Entity 'Knowledge__kav' is not found. Contact the vendor for more details.

 

3. (Knowledge__kav.Audio_recording) Unable to find the SObject type for the record type 'Knowledge__kav.Audio_recording'

Knowledge__kav.Audio_recording: Unable to find the SObject type for the record type 'Knowledge__kav.Audio_recording'

 

4. (Knowledge__kav-Audio_recording) Parent entity failed to deploy

Knowledge__kav-Audio_recording: Parent entity failed to deploy

 

5. (Knowledge__kav) In field: fullName - no CustomObject named {namespace}__Knowledge__kav found

Knowledge__kav: In field: fullName - no CustomObject named {namespace}__Knowledge__kav found

 

6. (Knowledge__kav-en_US) Invalid object name: Knowledge__kav

Knowledge__kav-en_US: Invalid object name: Knowledge__kav

 

If we tried to include Knowledge__kav.object file inside objects/Knowledge__kav folder, another error was added at the beginning:

 

1. (Knowledge__kav) When Lightning Knowledge is enabled, you can’t add an article type.

Knowledge__kav: When Lightning Knowledge is enabled, you can’t add an article type.

 

Seems it treats that knowledge object as namespaced that comes from the package

It would be very useful if anyone can give a hint how to resolve this. Or only solution is to have no namespaced unlocked package?

 

Thanks!

1 commento
0/9000

Is it possible to enable the PardotScFeaturesCampaignInfluence feature in scratch orgs?

I think in need this feature to get this Campaign Influence errors fixed:

"Invalid field:OPPORTUNITY.NAME in related list:RelatedCampaignInfluence2CampaignList"

 

Also is it possible to enable Embedded Dashboard is scratch orgs?

"Your org doesn't have access to component runtime_marketing_btobma:embeddedCampaignDashboard."

 

Cannot find any documentation about this.

3 commenti
0/9000

It can always be a daunting task to take an existing Unpackaged metadata and migrate it to DX. Well, not anymore...

 

Use the power of Graph Databases to carve out package boundaries, for your unpackaged metadata.

 

You don't need to be an expert in Graph Databases. The following npm package takes care of exporting metadata dependencies in a format that can be directly imported into Neo4J, a popular Graph Database.

 

https://www.npmjs.com/package/sf-dep-graph

 

Watch how easy it is to take a sample application, and migrate it to DX, using a simple iterative approach:

 

https://youtu.be/O5UsiJPFPzs

 

#Salesforce Platform #Salesforce Developer #Unlocked Packages #DX Packaging

0/9000

https://sfdc-db-gmail.github.io/unlocked-packages/faq-unlocked-pkgs.html

 

" One of the known issues with namespaced unlocked packages is that the Apex in such a package is hidden (in installed orgs) and the experience associated with debug logs is sub-optimal (as info in debug logs are obfuscated). It is on the roadmap to fix this so that Apex in namespaced unlocked packages is visible in installed orgs, but the earliest that can happen is Summer ‘19. "

 

Does anyone have visibility on the roadmap for this fix?  Our system debugs are not appearing in our namespace.

7 risposte
  1. 24 ott 2022, 15:57

    There's been no way around the conflict between the locked & unlocked package.  As a solution we created a new namespace that we will solely use for unlocked packages

0/9000

(Initially the question was posted in Salesforce DX group https://trailhead.salesforce.com/trailblazer-community/feed/0D54S00000K1JqdSAF)

Hi all,

I wonder if anybody was able to package Banker, BranchUnit, or BranchUnitBusinessMember related metadata in an unlocked package?

The issue as I see it is the scratch org default user doesn't have a Permission Set assigned to it necessary to access the objects' fields. This can be "Financial Services Cloud Extension" or "Financial Services Cloud Comprehensive" PS. The PS itself is added to the scratch org with one of the features mentioned on scratch org definition file: FinancialServicesUser, FinancialServicesInteractionSummaryUser, FinancialServicesDealMgmt, or IndustriesBranchManagement (these ones I tested). However, without the PS assigned to the user, it doesn't see e.g. Banker or BranchUnit fields in ObjectManager.

When I try to create a package version with e.g. Banker.object-meta.xml (let's say I customized search layout), I get error that a standard field not found.

This Known Issue may be related, but the fix doesn't resolve my issue.

#Unlocked Packages #Financial Services Cloud

0/9000