bullhorn / extension-configuration-starter

5 stars 26 forks source link

Can't upload to a secondary private Label only the primary #41

Open leonardosalatino opened 2 years ago

leonardosalatino commented 2 years ago

Tried with several ways to upload an interaction to a seconday private Label, changed interaction name, extension name, privateLabelIds property, etc.

The interaction is always populated to the primary private label defined in the user defined in the environment json file.

The only way I was able to upload an interaction to the different private label was by changing the "Private Label:" on user profile. The deploy is not working for other private labels regardless these are correctly set on the "Additional Private Labels:" field on user profile.

miola03 commented 2 years ago

@leonardosalatino - do you have the second private label set up within your environment.prod.json file? Each PL you want to deploy to should be set up as its own user within that config. Something like this:

{
  "users": [
    {
      "username": "user.name.pl1",
      "password": "password1",
      "privateLabelId": "1"
    },
    {
      "username": "user.name.pl2",
      "password": "password2",
      "privateLabelId": "2"
    }
  ]
}

These users need to be set up in BH ahead of deploying interactions through them which should be pretty straight forward as long as you have the admin rights to do so in the system

If the above is set up then each interaction you deploy should go to both PL's. If you want to restrict what PL the interaction deploys to you can configure your field interaction to utilize the privateLabelIds property:

const interaction: FieldInteraction = {
  fieldName: 'dateBegin',
  name: 'FI Name',
  enabled: true,
  event: 'init',
  sortOrder: 1,
  invokeOnInit: true,
  **privateLabelIds: [ '1', '2' ],**
}

That second to last line will restrict where the interaction gets deployed no matter how many users you have set up in your environment file.

If you have done all of the above maybe share a sample of the interaction you are trying to deploy along with your environment file set up and i can take a further look.

Hope this helps!

leonardosalatino commented 2 years ago

@miola03 - thanks for the help! Right, I tried the both of the above.

In issue #40 I uploaded a log file, in there you can see the two:

This means that the app is correctly reading the environment.json file and trying to upload to both private labels. But only the 1st deploy is correct; the 2nd deploy to the 2nd private label is failing because of duplicate interaction, this is because it is actually doing the deploy to the same 1st private label.

Thanks!