2

I stuck with issue with choosing custom profiles when 2nd gen package is installed. Package provides only 'No Access' and 'Full Access' settings, but in my project there are some custom profiles which I would like to choice.custom profile choice

When I have created package the metadata is

{
  "destinationProfiles": [
    {
      "description": "Full Access (Your profile must have full access to the package)",
      "displayname": "System Administrator",
      "name": " PT1",
      "noAccess": false,
      "profileId": "profileId",
      "type": "Admin"
    },
    {///All standard profiles from DEV HUB org}
  ],
  "sourceProfiles": [
    {
      "label": "No Access",
      "value": "__noAccess__"
    },
    {
      "label": "Full Access",
      "value": "__allAccess__"
    }
  ]
}

But 2-3 days ago I had another package metadata with the same profiles in project:

```{
  "destinationProfiles": [
    {
      "description": "Full Access (Your profile must have full access to the package)",
      "displayname": "System Administrator",
      "name": " PT1",
      "noAccess": false,
      "profileId": "profileId",
      "type": "Admin"
    },
{///All standard profiles from DEV HUB org}
  ],
  "sourceProfiles": [
    {
      "label": "No Access",
      "value": "__noAccess__"
    },
    {
      "label": "Full Access",
      "value": "__allAccess__"
    },
    {
      "label": "Custom Profile 1",
      "value": "Custom Profile 1"
    },
    {
      "label": "Custom Profile 2",
      "value": "Custom Profile 2"
    },
    {
      "label": "Custom Profile 3",
      "value": "Custom Profile 3"
    },
    {
      "label": "Custom Profile N",
      "value": "Custom Profile N"
    }
  ]
}

And when I installed the package I could choose settings for appropriate profile.

I used sf package version create -d force-app -x -w 30 command to create package version. There was no changes on my DEV HUB org (or there was but as I could see they did not affect packaging).

Mystery...

Can anyone help to resolve issue? Any thoughts are welcome :)

2
  • I don't have the answer, but why not delivering Permission Sets with your package, then assign users to them ? May 18 at 21:50
  • @NicolasVuillamy, thanks for your curiosity) My answer is because of earlier errorы in application architecture. So now we should leave it as is.
    – oldgunner
    May 19 at 6:19

1 Answer 1

2

After a millions and billions of investigation hours I found that "includeProfileUserLicenses": true attribute from packageDirectories in my sfdx-project.json file was accidentally deleted in one of previous merges.

Adding this attribute helped fixing the issue and all custom profiles appeared in package.

You must log in to answer this question.

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