getMethodTriggerEventName()?

Hello,

I’m basically thinking out load here, but for a given form, we might have separate methods for onShow, onRecordSelection, onDataChange, etc., and I would imagine the amount of code in each method isn’t that much, so it might help from an organization standpoint to have a single method in each form dedicated to processing these events. Maybe something like:

var eventName   = application.getMethodTriggerEventName();
var elementName = application.getMethodTriggerElementName();

if (eventName == 'onShow')
{
	// do stuff
}
else if (eventName == 'onDataChange')
{
	if (elementName == 'fld_first_name')
	{
		// do more stuff
	}
}
:
:
:

Might be helpful. I don’t know.

Regards,
Sean

Nope, just use seperate methods for seperate functions.

Combining these like you suggest will not make your code more accessible. When you are strict in your naming conventions you will benefit from it.

But ok, that’s just an opinion…

I agree with Marcel - well it’s the safest option :)

I used to use the flexibility of Javascript to combine lots of functions in a single method. But coming back a year or two later you have to try to remember which mega-Method holds the function you are looking for - and then scroll down through a couple of screens of ‘if’ and ‘switch’ groups.

Now seperate functions and use Method name to describe whats happening - ie: onShow_focusSurname or onDataCh_Surname_checkDups. Saves a lot of time later.

Regards

Graham Greensall
Worxinfo Ltd

Graham, what is the safest option?

Code like described or that you agree with me ;)

Marcel - I agree with you of course.

Anyone who is sooo big that their “location” straddles two countries deserves a lot of respect.

Graham