To get the Id of the current record:
var id = Xrm.Page.data.entity.getId();
To get the entity name:
var entityName = Xrm.Page.data.entity.getEntityName();
For more information see the Microsoft website: https://msdn.microsoft.com/en-us/library/gg334720.aspx

Keep learning. Keep building.
Explore AI, agents & Microsoft technology.
I share practical ideas, tutorials, and videos about AI, AI agents, Microsoft technologies, and the Power Platform.
Subscribe on YouTube →Carl de Souza Enterprise Architect at Microsoft · AI Technology Expert