Get the actual formName

I have a doubt, and for the moment i don’t know how to fixit.

The problem is, how can i get the actual formName. I want to say, if i edit a record, in my own dc_edit i have some comprobations and other action i do. But with the globals varaibles nav_currentPanel1Form, nav_current_formname not returning the correct form, and with the 2nd return the last tab loaded, that isn’t the tab i am editing.

I try too the variable globals.nav.getCurrentFormName() but they say is not a function valid, and i can’t see in any place.

Any idea? only I want is getting the actual form, independent if it is _dtl or _tbl, the actual visualization form.

pentamsi,

Do you edit from an event handler, like onaction or ondatachange?
Try the event parameter that is passed: event.getFormName()

Rob

Hi.

In “dc_edit”, “dc_new” and something else, we can see that can use the var “globals.nav_current_formname” for example but we want to used this var in “dc_delete” and when we’ll test we can’t see nothing, this var doesn’t are filled on this method and we cant do our work, it’s a bug?

We solved the problem with this method.

// Get the toolbar name
var toolbar = getToolbarFormName()

// Get the current form name
var currentForm = forms[toolbar].vFormname

// with the currentFrom we can know the parent form with this method
var parentForm = solutionModel.getForm(currentForm).extendsForm.name

But anyway we want to know if Servoy will do something respect this. You think will fill this global var or we need use our method?ç

Thanks in advance.

Hi Penta,

If I understand you correctly the global ‘nav_currentPanel1Form’ is not filled correctly in dc_delete. But I just tried that and it seems to be good. I used:

function dc_delete(_event, _noDialog) {
	application.output(globals.nav_currentPanel1Form)
	
//	return _super.dc_delete(_event, _noDialog)
}