Skip to Content
author's profile photo Former Member
Former Member

How to open UDT from code ?

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 ?

Add comment
10|10000 characters needed characters exceeded

2 Answers

  • Posted on Feb 15, 2017 at 12:11 PM


    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

    Add comment
    10|10000 characters needed characters exceeded

  • Posted on Feb 15, 2017 at 04:25 PM
                            oForm = Application.SBO_Application.Forms.Item(FormUID)   ' Or Application.SBO_Application.Forms.ActiveForm()  depends on the context
                            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
                            Dim UDFFormID = oForm.UDFFormUID
                            oFormUDF = Application.SBO_Application.Forms.Item(UDFFormID)
                        End Try

    I hope it works for you

    Add comment
    10|10000 characters needed characters exceeded