cancel
Showing results for 
Search instead for 
Did you mean: 

Datasource Not user Datasource

Former Member
0 Kudos

Hi,

i created one text box(Edit Text) in PO screen. i want to bind this field with ref2 in OPOR table. while binding its showing error

Datasource Not user Datasource. how to resolve this problem..

i used follwing code for binding.

Private oDBDataSource As SAPbouiCOM.DBDataSource

oDBDataSource = oOrderForm.DataSources.DBDataSources.Add("OPOR")

oItem = oOrderForm.Items.Item("Idtxt") // My Edit Text

oedit = oItem.Specific

'oedit.DataBind.SetBound(True, "OPOR", "Ref2") ''Error here

Regards,

Ganesh K

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Dear Ganesh Karunakaran,

You could define User-Defined Values on the text box field to link with ref2 in B1 application but not need SDK code.

Best Regards

Jane Jing

SAP Business One Forums team

Former Member
0 Kudos

Hi Ganesh,

u replace ur code as follows and try:

Private oDBDataSource As SAPbouiCOM.DBDataSource

oDBDataSource = oOrderForm.DataSources.DBDataSources.Item("OPOR")

oItem = oOrderForm.Items.Item("Idtxt") // My Edit Text

oedit = oItem.Specific

oedit.DataBind.SetBound(True, "OPOR", "Ref2") ''Error here

Kind Regards

Mohana

Former Member
0 Kudos

Hi Mohana,

i did as per the samples. anyway i tried your solution also.still its showing same error. but i can able to bind that Edit Text with UDF which i created in Marketing Documents Title.

Regards,

Ganesh K

Former Member
0 Kudos

Ganesh,

If ur dealing with a header level UDF then i guess ur passing the form reference worng. R u trying to move the field frm the UDF form to the normal form..??

Plz explain what u want to do..

Vasu Natari.

Former Member
0 Kudos

Hi,

Sorry for the mistake.U cant bind to DBDatasources.Instead of using DB Datasource use userdatasources.

Private URef2 As SAPbouiCOM.UserDataSource

URef2=oOrderForm.DataSources.UserDataSources.Add("URef2", SAPbouiCOM.BoDataType.dt_SHORT_TEXT, 50)

oItem = oOrderForm.Items.Item("Idtxt") // My Edit Text

oedit = oItem.Specific

oedit.DataBind.SetBound(True, "", "URef2") ''Error here

Kind Regards

Mohana

Former Member
0 Kudos

HI Vasu Natari,

i will explain my requirement.i created one text box(Edit Text) in PO screen (For Add-on Purpose) am getting some value in that text box

before adding PO. so am using binding for that text box for future reference. so i planned to save the values in "ref2" filed of OPOR table.(we are not using ref2 field in PO. thats why we planned use that). so i used the specified code above..

Regards,

Ganesh k

Former Member
0 Kudos

Ganesh,

But, If u added a UDF on the header leavel then u'll get in the UDF for the Doc, so y do u want to write code for that, SAP will add in in the Database just click on the menu to find the UDF form.

Under VIEW--> USER Defined Fields Or press CTRLSHIFTU

Hope it helps,

Vasu Natari.

Former Member
0 Kudos

Hi vasu Natari,

i think you misunderstanded my scenario. as i told i can able to bind my textbox with UDF(in Marketing Documents) easily without any problem. but i must bind my textbox with "ref2" field of OPOR table.

(i created Edit text field next to Currency selection option of PO)

Thanks in Adavnce,

Ganesh K

Former Member
0 Kudos

Hi Ganesh,

I understand your question and am looking for a similar answer - whether you can bind a text area to a system field. Have you found a solution to this problem? If so, thanks for sharing it, otherwise, I will let you know if I find one.

Jeff