generateUrl()

Generates a URL for a specified page reference.

Method InputTypeRequired/OptionalDescription
contextStringRequiredThe ID of the parent router container nearest to the component that's generating a URL. A ContextId is an opaque value that you get from the NavigationContext wire.
pageReferenceStringRequiredThe PageReference value for which to generate a URL.
  • If pageReference is valid, generateUrl() returns a string with the generated URL for the specified route.
  • If pageReference is invalid, it returns null.
  • If context is invalid, generateUrl() fails.

See Also