0

Is it possible to open Summary page direct from LWC? I tried

 this[NavigationMixin.GenerateUrl]({
          type: 'standard__recordPage',
          attributes: {
              recordId: id,
              objectApiName: 'PermissionSet',
              actionName: 'view'
          },
    })
      .then(url => {
          window.open(`${url}/summary`, "_blank");
          return;
      });    

but without any success

1 Answer 1

1

The GenerateUrl function only works to navigate to front-end types of records, like Accounts or Opportunities. Setup objects aren't supported. In fact, there's no standard mechanism to link to anywhere in Setup. Your best option would likely be to just use the standard__webPage PageReferencce type, something like:

{
    type: 'standard__webPage',
    attributes: {
        url: `/lightning/setup/PermSets/${id}/summary`
    }
}

Note the use of ` to form a template literal, allowing us to merge the variable directly into the string.

4
  • it works, but is it possible to open it separate window ?
    – pincet
    Commented May 11 at 12:46
  • @pincet If you want to do that, just use window.open.
    – sfdcfox
    Commented May 11 at 12:57
  • without using NavigationMixin, correct?
    – pincet
    Commented May 11 at 14:02
  • 3
    @pincet You can either use GenerateUrl with the object in my answer, then use window.open instead of the navigate function, or you can just use window.open directly without NavigationMixin. Either way should work.
    – sfdcfox
    Commented May 11 at 14:06

You must log in to answer this question.

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