Thursday 13 January 2022

How to add a connected app to a second-generation(2GP) managed package.

  1. Create a Connected App in Salesforce instance where we maintain namespace.
  2. Create a first-generation managed package (1GP) and add the connected app. It’s fine if the connected app is the only component in the package. Always use the same namespace as the 2GP package for the 1GP package.
  3. Take note of the version number of the connected app; this number is needed later.
  4.  Upload the 1GP Package to create a package version.
  5. Promote the 1GP version to the released state.
  6. Promoting the 1GP version allows the connected app to be included in a second-generation managed package. We don’t need to install the 1GP version into an org.
  7. Now in our source code navigate to folder "connectedApps" where we are trying to generate 2GP Package



create an XML file with <connectedAppName>.connectedApp-meta.xml 

and the body of the XML file should be as shown below.

<ConnectedApp xmlns="http://soap.sforce.com/2006/04/metadata">
    <developerName><namespace>__<connected_app_Name></developerName>
    <label>A Connected App</label>
    <version>1.0</version>
</ConnectedApp>

Now generate a 2GP package and promote. Then the connected app is automatically added to your 2GP Package.

The version specified in the source file is the version number of the connected app. Use decimal formatting when specifying the version number. The version number must match the version number of the connected app before it was added to the 1GP managed package.

Note:

When you add a connected app to a 1GP package and upload the package, the version number of the connected app is auto-incremented. For example, when version 1.0 of a connected app is added to a 1GP package, the package version increments the version number of the connected app from 1.0 to 2.0. When creating the source file for your 2GP package, specify the version number of the connected app before it was uploaded into a 1GP package, in this case, 1.0.



Reference:

https://developer.salesforce.com/docs/atlas.en-us.224.0.sfdx_dev.meta/sfdx_dev/sfdx_dev_dev2gp_connected_app.htm

Wednesday 5 January 2022

How to show user license information on report

 Hi ,

We are going to learn how to show user license information in a report.

In Lightning Experience:


  1. Click the gear icon, and click Setup
  2. Enter Report Types in the Quick Find box, and select Report Types
  3. Click New Custom Report Type
  4. In the Primary Object field, select Users
  5. Enter a Name, Label, Description, and Category for your new report type
  6. Select a deployment status
  7. Click Next, then Save
  8. Click Edit Layout
  9. Under the 'View' dropdown box, click the Add fields related via lookup link
  10. Click Profile
  11. Select User License, then click ‘view related fields
  12. Select NameStatus, and Total Licenses, then click OK
  13. Click Save























Once the above steps are completed we can generate reports by using the above report type with report builder.

Reference: 


What Is Salesforce Einstein Trust Layer?

 The Einstein Trust Layer elevates the security of generative AI through data and privacy controls that are seamlessly integrated into the e...