Disable opening form twice


#1

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?


#2

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

$App.doCommand({
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.