Disable opening form twice


I have a form for entity and this is important to open only one form on the screen. Can I restrict a user to be able to open only one form at a time? Could I catch the opening of the second form, prevent it to proceed and show error message to user?


I believe what you need is to specify tabId, when you open the form.

cmdType: 'showForm',
entity: 'ubm_form',
	isModal: false,

            // Unique tab ID
	tabId: 'ubm_form' + me.customParams.commandConfig.instanceID,

	formCode: 'ubm_form',
	instanceID: res[0].ID,
	target: UB.core.UBApp.getViewport().getCenterPanel()

This shall keep UB from opening form with the same tabId twice, instead if would activate existing form.