Populate Combo in matrix
Hi,
I have a Matrix.
In Each row i want like to populate matrix with values based on the row.
My problem is once a combo gets populated in one row, the same value
gets populated for other rows also(inspite of changing values)
This is my code
Do Until rsWHID.EoF = True
i = i + 1
Dim sLength As String
sLength = rsWHID.Fields.Item("Length").Value
WHOH_Form.DataSources.UserDataSources.Item("usLot").ValueEx = ""
Dim sDate As String = Convert.ToString(rsWHID.Fields.Item("DueDate").Value)
WHOH_Form.DataSources.UserDataSources.Item("usDate").ValueEx = Convert.ToString(sDate).Replace(".", "")
WHOH_Matrix.AddRow()
sQuerySOWO = "select u_ORDER,U_SOWO from [@CDIplanorders] WHERE u_iTEMcODE='" & sItemNo & "' AND u_lENGTH='" & sLength & "'"
rsSOWO.DoQuery(sQuerySOWO)
WHOH_Form.DataSources.UserDataSources.Item("usCmboSOWO").ValueEx = ""
WHOH_Combo = WHOH_Matrix.Columns.Item("cmbSOWO").Cells.Item(i).Specific
For j = WHOH_Combo.ValidValues.Count - 1 To 0 Step -1
WHOH_Combo.ValidValues.Remove(j, SAPbouiCOM.BoSearchKey.psk_Index)
Next j
If Not rsSOWO.EoF() Then
Do Until rsSOWO.EoF = True
Dim strOrderNO, strWOorSO As String
strOrderNO = rsSOWO.Fields.Item("u_ORDER").Value
strWOorSO = rsSOWO.Fields.Item("u_SOWO").Value
WHOH_Combo.ValidValues.Add(strOrderNO, strWOorSO)
rsSOWO.MoveNext()
Loop
End If
rsWHID.MoveNext()
Loop
Pls help.
The design of the matrix implies that all row-comboboxes have the same data, you cannot change that.
Maybe use the double click event to popup a form and show the different possible values depending on the row
Similar Messages
-
Populate combo in jsp without javascript?
hai all,
can u tell me how can i populate combo in jsp, is it possible without javascript?Quite easily, in pseudo code <%
List myList = (List)session.getAttribute("theList");
%><select name="myOptions"><%
for (items in the list)
%><option value="<%= item.value %>"><%= item.label %></option><%
%>
</select> -
Hi,
How can I populate a combo box in a matrix with different values?
The combobox will have a dynamic data coming from a table for each description.
Supposed, if I my matrix would look like the following.
Description Option(combobox)
ABC Yes/No
DEF Excellent/Good/Poor
GHI High/Medium/Low
How would I do it?
Thanks,Hi jaun,
you write the code in Key_Down Event Of Description field
'Assuming clCombo as Combobox column,DESCUID as Description field ColUID and it is Edit Text
If Description field is also combo box then you add this code in Combo_Select in before action false
if pVal.ColUid="DESCUID" and Pval.Row>0 then
dim objCombo as SAPbobsUICOM.ComboBox
dim i as integer
objCombo =objMatrix.Columns.Item("clCombo").Cells.Item(Pval.Row).Specific
for int=0 to objCombo.ValidValues.Count-1
objCombo.ValidValues.Remove(0)
Next
if objMatrix.Columns.Item("DESCUID").Cells.Item(Pval.Row).Specific.Value="ABC" then
objCombo.ValidValues.ADD("Y","YES")
objCombo.ValidValues.ADD("N","NO")
end if
if objMatrix.Columns.Item("DESCUID").Cells.Item(Pval.Row).Specific.Value="ABC" then
objCombo.ValidValues.ADD("E","EXCLLENT")
objCombo.ValidValues.ADD("G","GOOD")
objCombo.ValidValues.ADD("P","POOR")
end if
if objMatrix.Columns.Item("DESCUID").Cells.Item(Pval.Row).Specific.Value="ABC" then
objCombo.ValidValues.ADD("H","HIGH")
objCombo.ValidValues.ADD("M","MEDIUM")
objCombo.ValidValues.ADD("L","LOW")
end if
End if
Hope it helps you
Regards
Vishnu -
Populate Combo Box field into another field
I've got a form (form1) based off a table (table1). In the form I have a field from table1 called
bagtype that is a combobox type field with a row source from another table with two fields that show up in the drop down box when selected. When I select a field from the dropdown box only the first field populates the actual form field
(and underlying table) which is what I want. What I'd also like to happen is the second field of the combo box that doesn't populate the bagtype field is for it to populate another field (from table1) on the same form and store that
value in the underlying table as well. The other field in the form is called
AStd.
TAKHi,
you need 1 line of VBA code in the AfterUpdate event of the combo box:
Me!NameOfTheTargetFieldOrControl = Me!BagType.Column(1)
The column index is zero based i.e. 0 = first column of the combo box, 1 = second column etc.
cu
Karl
Access FAQ (de/it): donkarl.com
Access Lobby: AccessDevelopers.org -
Populate Combo box from recordgroup
I made a procedure to Get the values for a combo box these procedure send the values to another procedure that create a recordgroup and populate the recordgroup and the list. I'm not having errors at compilation time but the list is empty and I have values entered. What would it be.
Eunice,
did you call populate_list('<user_list>',<recordgroup>) ?
Please provide code snippets.
Frank -
Hi all,
Please help me to populate a combo box on runtime.
vcclient_no:=FK_SPLIT(vcBuffer);
vcpol_ref:=FK_SPLIT(vcBuffer);
vcmake:=FK_SPLIT(vcBuffer);
vcmodel:=FK_SPLIT(vcBuffer);
vcchassis:=FK_SPLIT(vcBuffer);
i need to populate the values in these variable to a combo box.There is a built-in called ADD_LIST_ELEMENT, this will help you.
-
Hi,
How do I check whether a combo is selected? The combo is bind to the matrix using screen painter.
I have tried this but it is not working:
oMatrix.Columns("ColName").Cells.Item(i).Specific.Selected.Value = ""
I am using VB and 2004B. Help appreciated.Hi,
If ((pVal.EventType = SAPbouiCOM.BoEventTypes.et_GOT_FOCUS And pVal.ItemUID = "Matrix1" And pVal.ColUID = "ColumnID" And pVal.Before_Action = False)) Then
oCombo = oMatrix.Columns.Item(pVal.ColUID).Cells.Item(pVal.Row).Specific
If oCombo.Selected Is Nothing Then
oCombo.Select(0, SAPbouiCOM.BoSearchKey.psk_Index)
Else
SBO_Application.MessageBox("Combo selected")
End If
End If
This event gives me a selection even before losing the focus of combobox item.
Hope it may be of use to u.
Cheers
Manu -
Hi All,
I have created a matrix with priceunitColumn.this field is linked to a no Object type table.My problem is iam not getting the define new option in the combo.Also i cant get all the values from the table in the combo.How should i achieve this.
Thanx in advance.
Regards
MohanaHi..
Try this code it will work..
Dim oPopUp As SAPbouiCOM.Form REM Define New Form (Global)
Private Sub LoadFromXml(ByVal fileName As String)
Dim XmlDoc As Xml.XmlDocument
Dim Xmlstr As String
XmlDoc = New Xml.XmlDocument
Dim SPath As String
Try
SPath = IO.Directory.GetParent(Application.StartupPath).ToString
XmlDoc.Load("C:\Program Files\SAP\SAP Business One\AddOns\Ur Srf Folder" & "\" & fileName)
SBO_Application.LoadBatchActions(XmlDoc.InnerXml)
oPopUp = SBO_Application.Forms.Item("define sfr form ID")
Catch ex As Exception
SBO_Application.MessageBox(ex.Message)
End Try
oPopUp.Visible = True
End Sub
Item Event
If pVal.FormUID = "UID" And pVal.ItemUID = "ComboID" And pVal.BeforeAction = False And pVal.EventType = SAPbouiCOM.BoEventTypes.et_COMBO_SELECT Then
Try
ocombo = FormS.Items.Item("ID").Specific
If ocombo.Selected.Value = "-9" Then
LoadFromXml("Define NewSRF .srf")
End If
Catch ex As Exception
SBO_Application.MessageBox(ex.Message)
End Try
End If
Regards..
Billa 2007 -
How to add combo in system matrix ? I am adding a column in the matrix of A/R invoice.I am using the following code-
Dim matMatrix As SAPbouiCOM.Matrix
Dim objColumn As SAPbouiCOM.Column
Dim ddlAP As SAPbouiCOM.ComboBox
objForm = SBO_Application.Forms.ActiveForm
If objForm.DataSources.UserDataSources.Count = 228 Then
objForm.DataSources.UserDataSources.Add("ddlAP", SAPbouiCOM.BoDataType.dt_LONG_TEXT, 50)
End If
matMatrix = objForm.Items.Item("38").Specific
matMatrix.Clear()
If matMatrix.Columns.Count = 265 Then
objColumn = matMatrix.Columns.Add("AP", SAPbouiCOM.BoFormItemTypes.it_COMBO_BOX)
Else
objColumn = matMatrix.Columns.Item("AP")
End If
objColumn.DataBind.SetBound(True, "", "ddlAP")
'objColumn.TitleObject.Caption = "AP Invoice"
objColumn.Width = 100
objColumn.Visible = True
matMatrix.Columns.Item("AP").DisplayDesc = True
matMatrix.Columns.Item("AP").TitleObject.Caption = "A/P Invoice"
ddlAP = matMatrix.Columns.Item("AP").Cells.Item(0).Specific
objForm.Refresh()
But the combo is note getting displayed.Hi Dilip,
You cannot change (add or modify) a system matrix via SDK. If you need to add a ComboBox in a system matrix you need to create a UserField with ValidValue or connected to a User Table.
Regards,
Vítor Vieira -
hi
im using combo in my matrix
how to load data from database table to column(ocombo) of the matrix
plz help me
Edited by: hareeshKR on Jul 18, 2011 12:37 PM
Edited by: hareeshKR on Jul 18, 2011 1:15 PMHi,
ObjMatrix = ObjForm.Items.Item("6").Specific
ObjCombo = ObjMatrix.Columns.Item("4").Cells.Item(row).Specific
strSQL="Select Code,ItemName from OITM"
obRS= objAddOn.objCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
objRS.doQuery(strSQL)
for i=1 to objRS.recordcount
ObjCombo.ValidValues.Add(ObjRS.Fields.Item("Code").Value, ObjRS.Fields.Item("ItemName").Value)
ObjRS.MoveNext()
Next -
MS Excel/VBA: Querying DB to populate combo boxes
Hi.
I am trying to populate five different combo boxes.
They are in an order of importance - market, product, duration, trade period description and trade date. Therfore, if a user selects a different market, then all of the other combo boxes should automatically update to show, for example, only the products which operate in that market should be visible, and this should be iterated all of the way down the other three combo boxes.
I have written code for this to happen so the query for product only includes those for that market.
However, when I use the ListFillRange to select all of the available products and populate the combo boxes an error occurs sometimes stating "Application-defined or object-defined error". It highlights the .Refresh BackgroundQuery:=False line.
Is there a better way to go about completing this task?
Thanks, Dan.Sometimes I've seen this in access with form, where the database data has either something line a linefeed character or a load of spaces before the actual
text eg " text" in which case the
columns in the control will be too narrow.
You could try udjusting your coulumns width in its control
You might need to loop through each item in the cotrol and adjust using say
the MID() function or the TRIM() function. -
Combo inside matrix, help me
Dear all,
In my application i have combox in matrix, Values of combo i added (1, 2,3,4...). now when user click button in form it will assign for combobox is 1 or 2 ..... I try this code but error"
oComboBox = oMatrix.Columns.Item(colName.ToString).Cells.Item(i + 1).Specific()
oComboBox.Select(1, SAPbouiCOM.BoSearchKey.psk_ByValue)
Please help me. THanksWhat is the error message?
Im using it as
For q = 1 To Matrix.RowCount
com = Matrix.Columns.Item("c1").Cells.Item(q).Specific
com.Select(0, SAPbouiCOM.BoSearchKey.psk_Index)
Next q
and its working. -
Hola a todos.... el problema que tengo y espero me puedan ayudar es que tengo un matrix de sap, pero nesesito que una de las columnas de ese matrix en ves de mostrar texto me muestre un combo con informnacion de los turnos de una empresa ....alguien me puede ayudar .. este es el codigo que estoy ocupando:
For Li_Fila = 0 To Lo_Personal.TotalFilas - 1
Lo_Personal.Fila = Li_Fila
Lo_UserDataSource = Mo_Forma.DataSources.UserDataSources.Item(MatrixCambiaTurnosNumero)
Lo_UserDataSource.Value = Lo_Personal.Empleado
Lo_UserDataSource = Mo_Forma.DataSources.UserDataSources.Item(MatrixCambiaTurnosOriginal)
Lo_UserDataSource.Value = Lo_Personal.TurnoDescripcion
''En esta columna es en la que deseo mostrar el combo.....
__Lo_UserDataSource = Mo_Forma.DataSources.UserDataSources.Item(MatrixCambiaTurnosCambio)__
__Lo_UserDataSource.Value =Lo_cboTunos.Selected.Description__
Lo_grdMatrixCambiaTurnos.AddRow()
Next
Asi como lo tengo ahora me muestra la forma de combo con un valor pero al darle click no me despliega el resto de los valores....
alguien sabe como puedo solucionar esto
De antemano les agradesco ....Jorge Luis
Sobre el punto que mencionas te puedo decir lo siguiente:
' Creando los UserDataSources para la columna tipo combo
oMyForm.DataSources.UserDataSources.Add("udsColumna", SAPbouiCOM.BoDataType.dt_SHORT_TEXT)
oMatrix = oMyForm.Items.Item(MyMatrix).Specific
oColumns = oMatrix.Columns
' Asignando el UserDataSources a la columna tipo combo
oColumns.Item("c_Columna").DataBind.SetBound(True, "", "udsColumna")
oMatrix = oMyForm.Items.Item(MyMatrix).Specific
oColumns = oMatrix.Columns
' Agregando valores al combo de la columna tipo combo
oColumns.Item("c_Columna").ValidValues.Add("M", "Mañana")
oColumns.Item("c_Columna").ValidValues.Add("T", "Tarde")
oColumns.Item("c_Columna").ValidValues.Add("N", "Noche")
oColumns.Item("c_Columna").DisplayDesc = True
oRecordSet.DoQuery("SELECT CODE, NAME FROM [@TABLE]")
Dim index As Integer = 1
' Cargando valores a las filas de la matrix
oMatrix = oMyForm.Items.Item(MyMatrix).Specific
While Not oRecordSet.EoF
oMatrix.AddRow(1)
oMatrix.GetLineData(index)
oUserDataSource = oMyForm.DataSources.UserDataSources.Item("udsColumna")
oUserDataSource.Value = oRecordSet.Fields.Item("CODE").Value.ToString.Trim
oMatrix.SetLineData(index)
index += 1
oRecordSet.MoveNext()
End While
Si revisas bien este codigo primero llenas la columna que es tipo combo con sus valores posibles, puedes usar un oRecordSet para llenarla si es que los datos los tienes en una tabla y pueden varias.
Al usar UserDataSource en una matrix debes usar las funciones GetLineData(index) y SetLineData(index).
Bueno espero que esto aclare tus dudas, si todo sale bien seria bueno que lo comentes.
Saludos
George -
LoadBatchActions to Populate a Matrix
We have managed to work out some XML that can be passed to LoadBatchActions to populate a matrix in a single call (With performance being the goal), however it doesn't seem possible to populate combo box columns using this mechanism. Is there a way to populate combo box matrix cells with data using LoadBatchActions? What we have so far is something like this, but the LnType2 column is causing the operation to fail because it is a combo box column:
<?xml version="1.0" encoding="UTF-16"?>
<Application>
<forms>
<action type="update">
<form appformnumber="2000071350" uid="FSE_0000000">
<items>
<action type="update">
<Item uid="Matrix">
<Specific>
<rows>
<action type="add">
<row index="0" />
<row index="0" />
</action>
<action type="update">
<row index="1">
<column uid="Um2" string="EA" />
<column uid="LnType2" string="P" />
</row>
<row index="2">
<column uid="Um2" string="EA" />
<column uid="LnType2" string="P" />
</row>
</rows>
</Specific>
</Item>
</action>
</items>
</form>
</action>
</forms>
</Application>Hi Benjamin,
In the Business One UI API 2004 help file you could find an issue named "Adding Forms with XML" where it is explained the file format.
Moreless, you should use the valid values property under ItemSpecific tag to set the possible options, and then add some datasources to link the controls on the matrix with the tables in the DB.
Regards
Ibai Peñ -
What is the best way to load 2 seperate tables to a single matrix
What I would like to do is create a date sorted list of customer orders and purchase orders for a single item(part) and populate a single matrix.
and did i mention quick...Hi!
i suppose you sould create for example UNION query:
SELECT docdate, cardname, 'purch', docnum FROM OPCH
UNION
SELECT docdate, cardname, 'order', docnum FROM OPOR
ORDER BY 1
Then execute oRS.DoQuery and populate your matrix inside a loop...
propably, somebody can give you some more advices..
hope it helps..
Maybe you are looking for
-
Hello, My X201s surprisingly overheated and soft-shut down. Upon rebooting the BIOS interrupted startup just to say "Fan Error" and shut down again. Has anyone seen this issue before? Up until now the fan has been working! I took the keyboard off, an
-
My menu is all greyed out, the only available option is "get more 3d content": Any suggestions? I have a HP Pavilon dv7 intel i7 with a HD Grpahic (3000 i think) Family video card. Adobe Photoshop Version: 2014.2.2 20141204.r.310 2014/12/04:23:59:59
-
Kernal Panic - iMac G5 - 10.3
Hi, On my iMac G5, running panther I get this When using Apple Mail sometimes when I open it the screen goes fuzzy and after a minute or so a kernal panic occurs. When I reboot all my mail is set to unread! Any suggestions on what to do? Thanks a lot
-
Creating a Relation between two Blocks - the Join Condition [SOLVED]
Hi. I'm trying to create a Relation between my TTMS_Audit table and my Bundle_Exceptions table. This is the join condition: ttms_audit.primary_key_values = bundle_exceptions.project_cd||','||bundle_exceptions.bundle||','||bundle_exceptions.exception_
-
"AlphaOmega" could not load in 64-bit mode.
I just updated to Lion and installed iTunes 10.4. Now when I start iTunes I get this message: "AlphaOmega" could not load in 64-bit mode. Try selecting "Open in 32-bit mode" in the Finder's info window for iTunes. Any ideas? I'm on a Core i5 MacBook