cancel
Showing results for 
Search instead for 
Did you mean: 

sdk connection

Former Member
0 Kudos

hi kings

I designed one form using screen painter... now how can i write the code for that form and how to add the menu in sap b1.....

Thanks & Best Regards

B.L.Narayanan

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Lakshmi,

try this thread

Regards,

Mahendra

Answers (1)

Answers (1)

Former Member
0 Kudos

hi,

assuming you installed the SDK in normal path of SAP B1.. you should take a look on this simple example :

c:\Program Files\SAP\SAP Business One SDK\Samples\COM UI\CSharp\04.WorkingWithXML\

the idea is you load the XML, attach events.. and after, most of logic is done by event handling...

Former Member
0 Kudos

Hi Lakshmi

Cristian LEONTE is Correct you can See that , Here the Sample Code to Load a Screen Painter to B1

First Of all Convert your Form to XML 1.e Rename your Form to .XML Extension

Then'

Public Function LoadScreenXML(ByVal FileName As String, ByVal Type As enuResourceType, ByVal FormType As String, ByVal FormUID As String) As SAPbouiCOM.Form

Dim objForm As SAPbouiCOM.Form

Dim objXML As New Xml.XmlDocument

Dim strResource As String

Dim objFrmCreationPrams As SAPbouiCOM.FormCreationParams

If Type = enuResourceType.Content Then

objXML.Load(FileName)

objFrmCreationPrams = objApplication.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_FormCreationParams)

objFrmCreationPrams.FormType = FormType

objFrmCreationPrams.UniqueID = FormUID

objFrmCreationPrams.XmlData = objXML.InnerXml

objForm = objApplication.Forms.AddEx(objFrmCreationPrams)

Else

strResource = System.Reflection.Assembly.GetExecutingAssembly().GetName().Name & "." & FileName

objXML.Load(System.Reflection.Assembly.GetExecutingAssembly.GetManifestResourceStream(strResource))

objFrmCreationPrams = objApplication.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_FormCreationParams)

objFrmCreationPrams.FormType = FormType

objFrmCreationPrams.UniqueID = FormUID

objFrmCreationPrams.XmlData = objXML.InnerXml

objForm = objApplication.Forms.AddEx(objFrmCreationPrams)

End If

Return objForm

End Function

Public Function LoadScreenXML(ByVal FileName As String, ByVal Type As enuResourceType, ByVal FormType As String, ByVal FormUID As String) As SAPbouiCOM.Form

In this Method Pass Your XML name,Type, FormUID as you Want

You Will get the Form object as Whole

Then Assign Like This

objForm = objAddOn.objUIXml.LoadScreenXML("InspectionCodeSetup.xml", "Type","UID"

objCombo = objForm.Items.Item("8").Specific

objCombo.Select("I", SAPbouiCOM.BoSearchKey.psk_ByValue)

objForm.Mode = SAPbouiCOM.BoFormMode.fm_ADD_MODE

objForm.Visible = True

Mohamed Zubair