cancel
Showing results for 
Search instead for 
Did you mean: 

OptionBtn/Radio button Bound to UDF on a Sales Order

Former Member
0 Kudos

Hello Experts,

I have a UDF that I would like to be bound to a option/radio button on marketing documents (Sales Order in particular).  I am able to create the OptionBtn in the usual way and add it to the Sales order through the SDK but I do not understand how to bind it to my UDF.  Any ideas?

I am able to bind it to a user data source, but how to bind this to my UDF?

Here is the relevant code:

Dim SORadioItem As SAPbouiCOM.Item = Me.m_oForm.Items.Add(CONSTANTS.SALES_ORDER_SO_RAD, SAPbouiCOM.BoFormItemTypes.it_OPTION_BUTTON)

            Dim WORadioItem As SAPbouiCOM.Item = Me.m_oForm.Items.Add(CONSTANTS.SALES_ORDER_WO_RAD, SAPbouiCOM.BoFormItemTypes.it_OPTION_BUTTON)

            Dim QuoteRadioItem As SAPbouiCOM.Item = Me.m_oForm.Items.Add(CONSTANTS.SALES_ORDER_QUOTE_RAD, SAPbouiCOM.BoFormItemTypes.it_OPTION_BUTTON)

            SORadioItem.Left = 225

            SORadioItem.Width = 75

            SORadioItem.Top = 469

            SORadioItem.Height = 19

            WORadioItem.Left = 225

            WORadioItem.Width = 75

            WORadioItem.Top = 489

            WORadioItem.Height = 19

            QuoteRadioItem.Left = 225

            QuoteRadioItem.Width = 75

            QuoteRadioItem.Top = 509

            QuoteRadioItem.Height = 19

            Dim SORadio As SAPbouiCOM.OptionBtn = SORadioItem.Specific

            Dim WORadio As SAPbouiCOM.OptionBtn = WORadioItem.Specific

            Dim QuoteRadio As SAPbouiCOM.OptionBtn = QuoteRadioItem.Specific

            SORadio.Caption = "Sales Order"

            WORadio.Caption = "Work Order"

            QuoteRadio.Caption = "Quote"

            WORadio.GroupWith(CONSTANTS.SALES_ORDER_SO_RAD)

            QuoteRadio.GroupWith(CONSTANTS.SALES_ORDER_SO_RAD)

           

            SORadio.ValOn = "S"

            WORadio.ValOn = "W"

            QuoteRadio.ValOn = "Q"

            ' Not correct:

            'SORadio.DataBind.SetBound(True, "", Me.m_oForm.DataSources.UserDataSources.Item("U_SODraftType").UID)

            'Bind to user data source, but how to bind the user data source to my UDF???????

            Me.m_oForm.DataSources.UserDataSources.Add("DrftTyp", SAPbouiCOM.BoDataType.dt_SHORT_TEXT, 9)

            SORadio.DataBind.SetBound(True, "", "DrftTyp")

            WORadio.DataBind.SetBound(True, "", "DrftTyp")

            QuoteRadio.DataBind.SetBound(True, "", "DrftTyp")

            SORadio.Selected = True

Accepted Solutions (1)

Accepted Solutions (1)

pedro_magueija
Active Contributor
0 Kudos

Hi Todd,

To bind to a UDF, you must tell it the name of the datasource:

.SORadio.DataBind.SetBound(true, "ORDR", "U_SODraftType");

Is this what you need?


Best regards,

Pedro Magueija


View Pedro Magueija's profile on LinkedIn

Former Member
0 Kudos

That's exactly what I needed.  Thanks Pedro!  I can't believe I didn't see that when looking at the definition of the SetBound Method! 

Answers (0)