After upgrading from 4.1 to 6 I had fixed all the warnings I had for using these deprecated functions. I use the proposed method, however, it does not work in all cases. I'm probably missing something here.
In my onShow script I call a method that hides certain elements on a form. It's a global method that needs to know by which form it was called.
- Code: Select all
/**
* @properties={typeid:24,uuid:"902CF6D6-5F08-4375-8284-BE6ACBF83A7A"}
* @param {JSEvent} event
*/
function onShow(event)
{
globals.gmd_hideSearchBtns(null, event);
...
Method to hide buttons:
- Code: Select all
/**
* @properties={typeid:24,uuid:"C89FE07F-019F-445F-BD19-B8F534E7374A"}
* @param {String} frmName
* @param {JSEvent} event
*/
function gmd_hideSearchBtns(frmName, event)
{
if ( !frmName ) {
frmName = event.getFormName();
...
While getMethodTriggerFormName returns the correct form, event.getFormName() does not. The Interactive Control shows:
=>event
true
=>application.getMethodTriggerFormName()
"tab_obj_bp"
I have the same problem, when I use search/find
- Code: Select all
/**
* @properties={typeid:24,uuid:"E9D5235E-9542-490D-B10E-F7FDD4A541A8"}
* @param {JSEvent} event
*/
function onFind(event)
{
globals.gmd_saveFoundset('tab_obj_bp');
globals.gmd_showSearchBtns(null, event);
controller.find();
}
/**
* @properties={typeid:24,uuid:"F884FAF1-CA24-4C0E-B6BC-BA9F99C18E49"}
* @AllowToRunInFind
* @param {JSEvent} event
*/
function onSearch(event)
{
globals.gmd_onSearch(null, event);
controller.search();
}
OnFind works (event has all the info), hitting enter to do onSearch just gives me event = true.
Can I change something that lets me use event.getFormName?
If that does not work, I can of course send the the form name in the frmName parameter or use a global variable, which I could set in the onShow method. I previously did not do that, since application.getMethodTriggerFormName() worked and I only needed the parameter for overrides.
Thanks,
Reto