cancel
Showing results for 
Search instead for 
Did you mean: 

Call UDO EditTextBox SAP B1 SDK

Former Member
0 Kudos

Dear All,

   How to Call UDO in  EditTextBox  using SAP B1 SDK?

Accepted Solutions (0)

Answers (1)

Answers (1)

pedro_magueija
Active Contributor
0 Kudos

Hi Lakshmi,

What do you mean with call? You can bind an edittext to your UDO.


Parameters

Bound

Indicates whether to bind or unbind the item:

False: Unbind (default)

True: Bind

TableName

The name of a database table. For user data sources, leave this field empty.

Alias

For DBDataSource: The alias of a database field

For UserDataSource: The unique ID of the user data source

Remarks

This method is valid for user-defined items only.

Example

Binding a data source to an item (Visual Basic)

Public Sub BimdingDataSourceToItem()

    Dim oForm As SAPbouiCOM.Form

    Dim oEditText As SAPbouiCOM.EditText

    '// Add a form

    Set oForm = SBO_Application.Forms.Add("SimpleForm")

    '// Add a UserDataSource to the form

    oForm.DataSources.UserDataSources.Add "EditSource", dt_SHORT_TEXT, 20

    '//*************************

    '// Adding a TextEdit item

    '//*************************

    Set oEditText = oForm.Items.Add("EditText1", it_EDIT).Specific

    '// Bind the text box to the UsedDataSource

    oEditText.DataBind.SetBound True, "", "EditSource"

End Sub

See Also

DataBind Object

More information in the SDK Help Center and in the Samples directory.


Best regards,

Pedro Magueija


View Pedro Magueija's profile on LinkedIn

Former Member
0 Kudos

Hi Pedro,

   Thanks for your reply. I tried it. But It does not work. Ok i will explain my Task.

  1.    I am using in SAP BUSINESS ONE STUDIO for my TASK.
  2.    Incorporate BUSINESS PARTNER SYSTEM Form in my Project.
  3. Create UDO .
  4.       Create UDF in BP Master Table.
  5.      Add UDF into System Form using Data Source in SAP Business one Studio Control Property.

      Run the application ,It does not work, Why?

pedro_magueija
Active Contributor
0 Kudos

Hi Lakshmi,

When you create a UDF on a system table then it becomes automatically part of the object for that table (in your case BP). All you have to do is bind the textbox to the correct column and table.

DataSource will be OCRD

Alias will be U_TheNameOfYourColumn

For some reason my Studio didn't let me type the datasource so copy one that already has the values such as the cardcode.


Best regards,

Pedro Magueija


View Pedro Magueija's profile on LinkedIn

Former Member
0 Kudos

Hi

   Thanks for your reply. I set User Fields in the Alias Property and Datasource OCRD.But It does not work. Please let me know how to solve this ?

pedro_magueija
Active Contributor
0 Kudos

Hi Lakshmi,

Did you also add the UDO to the form properties?


Pedro Magueija


LinkedIn Logo View Pedro Magueija's profile on LinkedIn
Follow @pedromagueija on Twitter

If this answer is helpful or correct, marking it as such is a form of saying thank you.