CRM2013: Getting current form name via JavaScript

Today i had to write a function that worked on a particular form at a current stage within a business process flow. The snippet below shows how you can retrieve the name of the current form. function getCurrentFormName() {     var formName = Xrm.Page.ui.formSelector.getCurrentItem().getLabel();     if (formName == 'Lead Referrer Form') {     […]