cancel
Showing results for 
Search instead for 
Did you mean: 

Question about UDO and Screen Painter

Former Member
0 Kudos
725

Hi all,

I've some questions about UDO and Screen Painter. Hope someone can help me. Thank you very much.

Q1. I've registered a table with child table and got a form with Grid. If I want to add the second row in Grid, I need to right click on row 1 and select "Add Row". Is it possible to do "Auto add row"? That means do not need to press any key and I can input in row 2.

Q2. What's the usage for Data Table (Query) in Screen Painter? Is it used to get data by Query?

Q3. If Q2 = Yes, I've tried to add new query to get current user name but it's failed.

My step:

Press Tab Collection > Select Data Tables > Press New >

Type "SELECT T0.U_NAME FROM OUSR T0 WHERE INTERNAL_K = $[USER] " in Query and press Set >

Then go to the field which I need to store the user name > Select query in Data Table Id (drop down list) > Save Form to Database

An error "UIAPI LoadBatchActions failed:" appeared and cannot open the form.

Thanks,

KY

View Entire Topic
Former Member
0 Kudos

Hi,

I didn't understand - do you plan to write your own Add-On to handle this form, or just want to perform some changes to the form without coding?

Q1: This can be achieved using code.

Q2: DataTable is used as an underline source for Grid object. You can bound a Grid object to the DataTable, and then perform some query to fill the DataTable. This will automatically fill the Grid as well. Any change in the DataTable will affect the display in the Grid and vice versa.

Q3: Queries in DataTable do not accept any shortcuts which are used in the SBO application. Also as I've mentioned, DataTables can be bound to Grids, not to a single field.

Hope it was helpful,

Beni.

Former Member
0 Kudos

Hi Beni,

I will write an Add-on to handle this form.

Q1. Can you teach me and provide the sample code? Or where can I find more information?

Q2 & Q3. Noted and I try to write a Query to get data but it failed.

Failed:

SELECT T0.empID, T0.LastName, T0.FirstName FROM OHEM T0 WHERE T0.empID = $[@ABCM.UserSign]

If I entry:

SELECT T0.empID, T0.LastName, T0.FirstName FROM OHEM T0 WHERE T0.empID = '1', it's work

Sorry that I'm not sure what's the meaning of "shortcuts which are used in the SBO application"

Thanks for your help

Regards,

KY

Former Member
0 Kudos

Hi KY,

Q1: you should decide when the new row will be added, then catch the corresponding event and add the row.

For example, if you want to add the row whenever the user presses TAB whike standing on the last column of the grid, you code should be something like this:

if pval.EventType = BoEventTypes.et_KEY_DOWN and not pval.BeforeAction and pval.CharPressed = 9 Then

     oGrid.DataTable.Rows.Add()

End If

Q2: $[@ABCM.UserSign] is a shorcut used in SBO application only. You can not use it in the API. Instead, you should build your query using the APIs. For example:

strSQL = "SELECT T0.empID, T0.LastName, T0.FirstName FROM OHEM T0 WHERE T0.

userId = " & oCompany.UserSignature.ToString

Beni.