cancel
Showing results for 
Search instead for 
Did you mean: 

copying one udo object data to another

Former Member
0 Kudos

Hello

My scenario which I would like to achieve is this:

I have two udo objects. I created them with B1 DE.

From withing one form I (which is based on udo1) I would like to programmaticaly open another form (which is based on udo2).

This newly created form should be in add mode. Then I would like to copy some of the data from udo1 data table (in database)

to udo2 data sources (like data tables, dbdatasources).

This is important - data that is already in database in udo1 should be copied first to udo2 data sources and then eventually to database.

How to achieve this?

Thanks

Kamil

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

HI

copy using data sources

strQuery5 = "SELECT * FROM [yourfitstudo]

objRec = objMain.objUtilities.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)

objRec.DoQuery(strQuery5)

If objRec.RecordCount > 0 Then

objSecondUDO= bForm.DataSources.DBDataSources.Item("@SecondUDO_TABLE")

objSecondUDO.SetValue("U_EnvItmCd", objSecondUDO.Offset, objRecSet.Fields.Item("U_EnvItmCd").Value)

end if

Rgds

Micheal

Former Member
0 Kudos

Ok, thanks. That may be good.

But how to open a form by clicking a button on another form?

When I try to do this it says it cannot load the type that represent that form.

Thanks

Kamil

Former Member
0 Kudos

HI ,

1) in the button click of first form

'''a sample code

Dim bForm As SAPbouiCOM.Form

Dim objImpEx As ClsImportExport

objImpEx = New ClsImportExport

bForm = objImpEx.LoadFormRef

2) This is the event being calle din second form

Public Function LoadFormRef() As SAPbouiCOM.Form

objForm = RefLoadForm()

Call LoadValidvaluesToForm(objForm.UniqueID)

Return objForm

End Function

Public Function RefLoadForm() As SAPbouiCOM.Form

Call objMain.objUtilities.LoadForm("Import Export Application.xml", "IMPE", ResourceType.Embeded)

objForm = gApplication.Forms.ActiveForm

objMain.objUtilities.MatrixAddRow(objForm.UniqueID, "109")

objForm.DataBrowser.BrowseBy = "12"

Return objForm

End Function

Rgds

Micheal

Former Member
0 Kudos

Thank You

I logged in with certificate login and, for some reason, I cannot add points to Your post.

Thanks again

Kamil

Trinidad
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Kamil,

When you create a new message in the forum you have to check the option "create as a question" in order to be able to give points to the people that answers you and also to mark the message as solved.

Please pay attention to it for the next message you create.

Regards

Trinidad.