cancel
Showing results for 
Search instead for 
Did you mean: 

create master matrix form

Former Member
0 Kudos

HI,

IS IT POSSIBLE TO CREATE A MASTER FORM HAVING A MATRIX LIKE PURCHASE ORDER WHERE ITEM DETAILS CAN BE ENTERED ?

AND WHEN I CREATE A MATRIX, ROW CAN'T BE SELECTED. I WROTE CODE AS FOLLOWS WHEN MATRIX DEFINED-------

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

'// Adding a Matrix item

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

oItem = oForm.Items.Add("Matrix1", SAPbouiCOM.BoFormItemTypes.it_MATRIX)

oItem.Left = 5

oItem.Width = 550 '350

oItem.Top = 80

oItem.Height = 320 '150

oMatrix = oItem.Specific

oMatrix.SelectionMode = SAPbouiCOM.BoMatrixSelect.ms_Single

oColumns = oMatrix.Columns

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Subrata,

Did i get u r not i dont knw. I think u want to add the data's from matrix to database.

For that u have to do is

If it is Predefined Screen u have to write in FormDataEvent.

If u add any fields and add to database mean u write as follows

If (BusinessObjectInfo.FormTypeEx.Equals("141")) And ((BusinessObjectInfo.EventType = SAPbouiCOM.BoEventTypes.et_FORM_DATA_ADD) Or (BusinessObjectInfo.EventType = SAPbouiCOM.BoEventTypes.et_FORM_DATA_UPDATE)) And (BusinessObjectInfo.ActionSuccess = True) Then

Try

BubbleEvent = False

Dim Doc As SAPbobsCOM.Documents

Doc = com.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oPurchaseInvoices)

Doc.Browser.GetByKeys(BusinessObjectInfo.ObjectKey)

Doc.UserFields.Fields.Item("U_Gpno").Value = CStr(API_Frm.DataSources.UserDataSources.Item("grno").Value)

Doc.Update()

BubbleEvent = True

Catch ex As Exception

app.MessageBox(ex.Message)

End Try

End If

Here instead of using oPurchaseInvoice u use the Purchase Order

If this helps give reward points,

Regards,

Anitha

Answers (2)

Answers (2)

Former Member
0 Kudos

yes,.. You can do this...

if u want to selected row... then use this code...Like..

if (oMatrix.IsRowSelected(k))

{

val = ((SAPbouiCOM.EditText)oMatrix.Columns.Item(ClsConstant.ColPROFAMCode).Cells.Item(k).Specific).Value;

Sval = ((SAPbouiCOM.EditText)oMatrix.Columns.Item(ClsConstant.ColSCode).Cells.Item(k).Specific).Value;

}

by this you can get sellected row and value of columns.

You can also write code for single line selected or multiline selected and if u want that No rows selected.. For this you can write more property (Not selected) of this..

rgds

deepak

Former Member
0 Kudos

I think sir, u didn't get my question.

Basically the question is ---

I've seen maximum examples of matrix to show the data from the database, not to insert the data in the database. Do u know the code of how to insert data from matrix to database?

And in the Purchase Order form after choosing the BP name, matrix is activated. But I can't do? Do u know how is it possible?

I need the code of it.

regards

Subrata

barend_morkel2
Active Contributor
0 Kudos

Hi Subrata,

Yes it can be done.

There is an example in the SDK Sample files to show you how to add and manage a matrix.

it is under:

C:\Program Files\SAP\SAP Business One SDK\Samples\COM UI\VB.NET\06.MatrixAndDataSources

Former Member
0 Kudos

The example is to show the data, not to insert the data in the database. Do u know the code of how to insert data from matrix to database?

And in the Purchase Order form after choosing the BP name, matrix is activated. But Ican't do? Do u know how is it possible?