cancel
Showing results for 
Search instead for 
Did you mean: 

Load form with first record of UDO

former_member203128
Participant
0 Kudos

Hi all

I do a form for my UDO. When a open the form I want to display the first record of my UDO

how i can resolve it?

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Alvaro,

You can also simulate clicking the "Go to first record" menu entry:


oApplication.ActivateMenuItem("1290")

Regards,

Vítor Vieira

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi

Normally UDO from loads with Find mode or otherwise you can forcefully make your query by selecting top one row and then auto click the find button......

Dim strQuery As String = "select Top 1 from [@Table]

Dim RecSet As SAPbobsCOM.Recordset

'Dim oCombo As SAPbouiCOM.ComboBox

RecSet = SBO_Company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)

RecSet.DoQuery(strQuery)

If RecSet.Fields.Item(0).Value <> 0 Then

Me.m_SBO_Form.Freeze(True)

Dim oItem As SAPbouiCOM.Item

oItem = Me.m_SBO_Form.Items.Item("1")

oItem.Click(SAPbouiCOM.BoCellClickType.ct_Regular)

Hope it helps