cancel
Showing results for 
Search instead for 
Did you mean: 

how to get the forefront form.

Former Member
0 Kudos

Hi all

problem:I want to know how to get the forefront form, when its lost focus.

Some forms are opening, and these forms are same formtype.

focus change to mainmenu and lost focus.

Then, How to get the forefront form's count through ui-api.

Accepted Solutions (0)

Answers (1)

Answers (1)

AdKerremans
Active Contributor
0 Kudos

Hi Koji,

The application.forms.count gives you the number of open form and the application.forms.activeform gives you the active form.

Regards

Ad

Former Member
0 Kudos

Hi Ad,

Thank you.

Sorry, I had to write more detail.

This problem concerned my addon.

My making Addon launch from MainMenu, my addon will make to dispose to forefront form.

I tried below.

using "application.forms.activeform"

When user launch addon from Mainmenu, Then mainmenu has focus yet. Then, in the addon

logic, "application.forms.activeform ".

It has value of "MainMenu"ID.not have forefront FormUID.

using "The application.forms.count"

"The application.forms.count" has launch order.

I think that it is not front order.

I'm sorry, I can't express that well.

AdKerremans
Active Contributor
0 Kudos

Hi Koji,

What are you trying to do, I don't really understand what you want exactly?

activeform gives the active form.

Regards

Ad

Former Member
0 Kudos

Hi Ad

sample code below:Now I'm trying.

scene:Some Delivery Document in SBO Desktop.

And my addon program loaded at mainmenu.

for example

Process 1.my addon starts up from MainMenu Window.

in my addon program's code below

This Code runs "SBO_Application_MenuEvent"

oForm = SBO_Application.Forms.ActiveForm

strTitle = oForm.Title()

strFormUID = oForm.UniqueID

getting value

strTitle="Main Menu"

strFormUID="F_22"

Process 2.my addon starts up from Modules Menu.

same code Process 1

getting value

strTitle="Delivery"

strFormUID="F_25"

I want to know how to get forefront Delivery form's UID by the Process1.

AdKerremans
Active Contributor
0 Kudos

Hi Koji,

I understand your question now.

If you start a form from the menu-form the menu-form is the active form and you want to know what was the active form, before the menu form became the active form.

I think here are not many options. I think you must set a global variable in your application that holds the active formUID. Everytime a form is activiated, you have to catch this event and set your global variable except when the menuform comes active.

I hope this will solve your problem.

Regards

Ad