on 09-22-2008 7:54 AM
Hi, i am implementing an addon, with additional data. how can i manage to use the browser arrows for my new form?
thank you, philipp
Hi,
If ur talking abt the Brouse buttons on the tool bar then u can use the menu event and write ur code to brouse the data, In case if ur dealing with a UDO then it will be much easier to use the browse fucntionality with a single line of code. Plz see the following code
objForm.DataBrowser.BrowseBy = "txtDocNo"
If u write the above code for a UDO form browsing will be taken care of.
Hope it helps,
Vasu Natari.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
well, i am creating a new form.
but i want that the form is bound to a user defined table. and i want that i can browse trough the data of this table with the arrows in the toolbar.
so how is this possible, because when i debug the program the arrows are not enabled.
and the second question is, how can i bind my data of this table to the items of the table?
Once u load ur form execute the following code to enable the browse buttons.
objForm.EnableMenu("1288", True)
objForm.EnableMenu("1289", True)
objForm.EnableMenu("1290", True)
objForm.EnableMenu("1291", True)
And u can bind the data to the fields directly in the screen painter.
Hope it helps,
Vasu Natari.
Just try with this check if its working.
objForm.DataBrowser.BrowseBy = "txtDocNo"
In place of Doc no use a valid item in ur form. and make sure all the items are data bound. I generally use it with UDO, just trry if it works for u too without a UDO.
Else in the menu event u need to get the Existing code or any required value and u need to get the next value from the data base and fill up the form with the values from the data base.
Hope it helps,
Vasu Natari.
hi, i have it like this:
oCreationPackage = (SAPbouiCOM.FormCreationParams)SBO_Application.CreateObject (SAPbouiCOM.BoCreatableObjectType.cot_FormCreationParams);
oCreationPackage.XmlData = xmlForm.InnerXml;
oCreationPackage.FormType = "frmStammdaten";
oCreationPackage.UniqueID = "frmStammdaten";
oForm = SBO_Application.Forms.AddEx(oCreationPackage);
oDBDataSource = oForm.DataSources.DBDataSources.Add("@ABC_FUHRPARK");
oForm.EnableMenu("1288", true);
oForm.EnableMenu("1289", true);
oForm.EnableMenu("1290", true);
oForm.EnableMenu("1291", true);
oForm.DataBrowser.BrowseBy = "txtKZ";
shouldn't then the auto managed button also be changed if i click on "Find" or "Add"?
When i click on "Find" the editboxes are changed to yellow. but the caption of the button remains the same.
Hi,
U need to bind each and every control to the corresponding field in the DB Table.
Check the below sample for that.
oEdit = oForm.Items.Item("txtTemp1").Specific
oEdit.DataBind.SetBound(True, "@BBBB", "Temp1")
And for the button problem try,
oForm.DefButton = "1" 'Use the UID of the Add update button
Hope this helps u..
Vasu Natari.
As per the best practices frm SAP we have to use DI objetcs which are provided. I suggest u use the DI objects.
Just check the below code snippet for adding the values to the data base using the DI objects
Private Function AddMovieToDatabase(ByVal Code As String, ByVal Name As String, ByVal Shelf As Integer, ByVal Space As Integer) As Boolean
Dim oUsrTbl As SAPbobsCOM.UserTable
Dim Res As Integer
AddMovieToDatabase = False
oUsrTbl = oCompany.UserTables.Item("VIDS")
oUsrTbl.Code = CInt(Code)
oUsrTbl.Name = Name
oUsrTbl.UserFields.Fields.Item("U_SHELF").Value = Shelf
oUsrTbl.UserFields.Fields.Item("U_SPACE").Value = Space
Res = oUsrTbl.Add()
If Res = 0 Then
AddMovieToDatabase = True
Else
SBO_Application.MessageBox("Error, failed to add movie")
End If
End Function
U can find the full project in the SDK samples in the following path, C:\Program Files\SAP\SAP Business One SDK\Samples\COM UI DI\VB.NET\UIDIBasicApp\VIDS
Hope it helps u,
Vasu Natari.
Thank you very much!
I only have one problem left, i can't find the user tables i added with the addUDO.
i want to link the object to the table with:
SAPbobsCOM.UserTable oUserTable = oCompany.UserTables.Item("ABC_Fuhrpark");
but unfortunately the table can't be found. in SBO i can only see the tables in the User-Fields dialog, but not in the user tables list.
what can that be? i added the tables as MasterData and Document
User | Count |
---|---|
88 | |
7 | |
6 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 | |
2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.