I'm trying to set up an Event for a particular form. Within the form properties, I'm understanding I need to go to the Event Handler and create a new event. And I also need to go to the Form Libraries and make sure they are set up correctly. I have tried several times to get this to work correctly but it's failing every time.
Here is my code:
var formContext = executionContext.getFormContext(); // get form context
var formType = formContext.ui.getFormType(); // get form type
if(formType == 1) {
formContext.ui.tabs.get(/tab_8/).setFocus();
}
// If form type is Update (2), navigate to another tab.
else if(formType == 2) {
formContext.ui.tabs.get(/SUMMARY_TAB/).setFocus();
}
}
/
My questions:
Do I need to create a whole new library to make this work?
Can I just add this to an existing library?
In the Event Handler, do I need to place the whole code in, or does something else go there?
I'm using the event /OnLoad/ is this accurate?