on 01-05-2017 4:48 PM - last edited on 02-04-2024 6:30 AM by postmig_api_4
Hi everyone,
If I use option "System Information" that allows me to see what form I currently hover with mouse I may observe that the "System messages log" have form uid = 683 (as at the picture attached).
Then I would like to know what height it has. For this I am using the code as below:
Form messageLogForm = Core.Connection.ConnectionHolder.Application.Forms.Item("683") as Form;
var height = messageLogForm.Height;
or
var height = Core.Connection.ConnectionHolder.Application.Forms.Item("10000020L").Height;
Core.Connection.ConnectoinHolder is my own class which is representing connection of my addon written in C# and SAP B1, current instance. Suppose "Core.Connection.ConnectionHolder.Application " is normal Application Object in SAP UI API.
The problem which I have is the error I am receiving whenever I would like to access this form object. Is that some special way to do so or somewhere is my mistake involved ? My main aim is to get to know how height is this system messages log tab at below the form.
Hi Dariusz,
For use the Forms.Item method you need know the formUID of form the message log form. Then I suggest you to use the Forms.GetForm method when supplying a type and instance count.
Dim messageLogForm As Form = Core.Connection.ConnectionHolder.Application.Forms.GetForm("683", 0)
Dim height = messageLogForm.Height
For the second parameter I believe that is not possible to open more than one message log form, so you can use 0. But if the message log form is closed, when you execute the line above, you will receive an exception.
Kind Regards,
Diego Lother
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Diego,
works well.
Thank you for your suggestion.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
98 | |
12 | |
11 | |
6 | |
6 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.