Skip to Content
0

How to open UDT from code ?

Feb 13, 2017 at 01:30 PM

152

avatar image
Former Member

As far i understand logic SAPBusinessOneSDK.dll all objects in SAP environment have UniqueID in witch i can create instanse this object and work with him through code.

So if i wont open some form through code i just find UniqueID this form and open it.

And i don`t have problem with UDO to open it because when i register UDO i manually.

But if i open some UDT (nodata type) through SAP B1, everytime UniqueID is different so i desided if UniqueID is different, SAP independently assigns new UniqueID.

At last question: How i can open UDT in Form without stable UniqueID ?

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

avatar image
Former Member Feb 15, 2017 at 12:11 PM
0

Hi,

It hard to understand what you are trying to do, so forgive me if I understood you wrong.

If you want to get a handle on the form that you just opened, without having its Uid, you can use Application.Form.ActiveForm.

If this does not answer your question, could you elaborate a bit more on what are your intentions?

Pedro Magueija

LinkedIn | Twitter | Blog

Share
10 |10000 characters needed characters left characters exceeded
Gabriel Gonzalez Salazar Feb 15, 2017 at 04:25 PM
0
                        oForm = Application.SBO_Application.Forms.Item(FormUID)   ' Or Application.SBO_Application.Forms.ActiveForm()  depends on the context

                    Try
                        Dim UDFFormID = oForm.UDFFormUID   'To know the ID of the corresponding UDF Form
                        oFormUDF = Application.SBO_Application.Forms.Item(UDFFormID)
                    Catch ex As Exception
                        'We use the CATCH to know if the UDF are closed, if so open by menu
                        Application.SBO_Application.ActivateMenuItem("6913")
                        Dim UDFFormID = oForm.UDFFormUID
                        oFormUDF = Application.SBO_Application.Forms.Item(UDFFormID)
                    End Try

I hope it works for you
regards

Share
10 |10000 characters needed characters left characters exceeded