Referencing the name of the current Component/Method/Page dynamically in a error message

Is there a way to reference the name of the current component/method/page in an error message?

Apex Designer automatically generates a service that has metadata for all the user interfaces in the app. To access the metadata of the current user interface:

const userInterface = this.apexDesignerUserInterfacesService.currentUserInterface();
debug('userInterface', userInterface);

The service is automatically included on every user interface so you don’t need to add a dependency for it.

1 Like