on 05-05-2006 6:09 PM
Hello...
I am using the following function to load a form from xml, I found this function here in forum, not mine, BUUUUT when trying runing the function I got:
"ERROR: Form - Reserved / Illegal form Unique ID"
I tryed change form name a bunch of times, but keep getting error.
If someone could help me I would be glad.
Private Function LoadXMLForm(ByVal sFile As String) As Boolean
Try
Dim oXMLDoc As MSXML2.DOMDocument
Dim oCreationParams As SAPbouiCOM.FormCreationParams
Dim s As String
Try
s = "c:/FormSample_simple.srf"
oXMLDoc = New MSXML2.DOMDocument
oXMLDoc.load(s)
oCreationParams = oapplication.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_FormCreationParams)
oCreationParams.XmlData = oXMLDoc.xml
oApplication.Forms.AddEx(oCreationParams)
Return True
Catch e As Exception
oApplication.MessageBox("Error: " & e.Message)
Return False
End Try
System.Runtime.InteropServices.Marshal.ReleaseComObject(oCreationParams)
System.Runtime.InteropServices.Marshal.ReleaseComObject(oXMLDoc)
Catch ex As Exception
oApplication.MessageBox("Error: " & ex.Message)
End Try
GC.Collect()
End Function
Try to add this line
oCreationParams.UniqueID = "formUid"
after
oCreationParams.XmlData = oXMLDoc.xml
Problem must be that the xml you load have a invalid Unique (Is the xml-form a system form?)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
So.... ^^ It worked.. btw.. i did it in screen painter.. i was double declaring the form @@ one loading from xml and another "code-generated" and I was triggering the visible for the code-generated...
thanks for you all anyway.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
ok... thnks... its loaded, BUUUT, loaded a blank form ^^ and only when i add this line.... sorry for my newb questions, but i am new to this stuff....
oform = oapplication.Forms.AddEx(oCreationParams)
oform.Visible = True
Message was edited by: Fernando Mendes Weffort
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
111 | |
12 | |
11 | |
6 | |
5 | |
4 | |
4 | |
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.