CFL on matrix
Hi all,
Can someone help me?
When i select the row on my CFL popup i get nothing on my edit Textbox (it's a matrix column). At beginning i got the error "La référence d'objet n'est pas définie à une instance d'un objet" but now this error has desappear.
I have used screen painter to add the CFL.
Regards.
Hi,
I don't get the error message now but when i click on select button in the A/R Invoice popup i don't get something in my matrix column.
This is my choosefromlist item event code :
If pVal.EventType = SAPbouiCOM.BoEventTypes.et_CHOOSE_FROM_LIST Then
Dim oEdit As SAPbouiCOM.EditText
Dim oCFLEvento As SAPbouiCOM.IChooseFromListEvent
oCFLEvento = pVal
Dim sCFL_ID As String
sCFL_ID = oCFLEvento.ChooseFromListUID
Dim oCFL As SAPbouiCOM.ChooseFromList
oCFL = oForm.ChooseFromLists.Item(sCFL_ID)
If oCFLEvento.BeforeAction = False Then
Dim oDataTable As SAPbouiCOM.DataTable
oDataTable = oCFLEvento.SelectedObjects
'Dim val As String
Try
With oForm.DataSources.DBDataSources.Item("@FTACT")
.SetValue("U_Fact", .Offset, oDataTable.GetValue(0, 0))
End With
Catch ex As Exception
End Try
If (pVal.ItemUID = "mtx_13") And (pVal.ColUID = "V_2") Then
Try
oEdit = oForm.Items.Item("V_2").Specific
oEdit.Value = oDataTable.GetValue(0, 0)
Catch ex As Exception
End Try
End If
End If
End If
Regards.
Similar Messages
-
Please any one help me how to add the cfl this matrix.
oNewItem = oOrderForm.Items.Add("Matrix1", SAPbouiCOM.BoFormItemTypes.it_MATRIX)
oNewItem.Left = 100
oNewItem.Width = 350
oNewItem.Top = oItem.Top + (i - 1) * 25
oNewItem.Height = 100
oNewItem.Visible = True
oMatrix = oNewItem.Specific
oColumns = oMatrix.Columns
oNewItem.FromPane = 9
oNewItem.ToPane = 9
oColumn = oColumns.Add("#", SAPbouiCOM.BoFormItemTypes.it_EDIT)
oColumn.TitleObject.Caption = "#"
oColumn.Width = 30
oColumn.Editable = False
'// Add a column for BP Card Code
oColumn = oColumns.Add("DSCardCode", SAPbouiCOM.BoFormItemTypes.it_COMBO_BOX)
oColumn.TitleObject.Caption = "Item Code"
oColumn.Width = 150
oColumn.Editable = True
oColumn.DataBind.SetBound(True, "opr1", "U_Code")Dear lakshmi narayanan,
First you need add the CFL before using it
Dim oCFLs As SAPbouiCOM.ChooseFromListCollection
oCFLs = oForm.ChooseFromLists
Dim oCFL As SAPbouiCOM.ChooseFromList
Dim oCFLCreationParams As SAPbouiCOM.ChooseFromListCreationParams
oCFLCreationParams = SBO_Application.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_ChooseFromListCreationParams)
oCFLCreationParams.MultiSelection = False
oCFLCreationParams.ObjectType = "2"
oCFLCreationParams.UniqueID = "CFL1"
oCFL = oCFLs.Add(oCFLCreationParams)
then add the CLF into the Column
' Adding a User Data Source
oForm.DataSources.UserDataSources.Add("EditDS", SAPbouiCOM.BoDataType.dt_SHORT_TEXT)
' Bind the Column with the UserDataSources
oColumn.DataBind.SetBound(True, "", "EditDS")
oColumn.ChooseFromListUID = "CFL1"
oColumn.ChooseFromListAlias = "CardCode"
Best Regards
Jane Jing
SAP Business One Forums team -
Hi to all,
How can i filter the System CFL which is in Matrix Column. I have filtered the System CFL in Form but unable to do in CFL of Matrix.
What i am trying to do is Filtering The Project Code CFL in A/R Invoice
Here is the code i have
if (pVal.FormTypeEx == "133" & pVal.ColUID == "4")
if (pVal.InnerEvent & pVal.Before_Action)
BubbleEvent = false;
SAPbouiCOM.Form oForm;
SAPbouiCOM.Column oColumn;
SAPbouiCOM.ChooseFromList oCFL = null;
SAPbouiCOM.Conditions oCons = null;
try
oForm = SboApplication.Forms.Item(pVal.FormUID);
oCFL = (SAPbouiCOM.ChooseFromList)oForm.ChooseFromLists.Item("26");
//AddChooseFromList();
oCons = oCFL.GetConditions();
if (oCons.Count == 0)
SAPbouiCOM.Condition oCon = null;
oCon = oCons.Add();
oCon.Alias = "PrjCode";
oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL;
oCon.CondVal = "000021";
oCFL.SetConditions(oCons);
BubbleEvent = true;
catch (Exception ex)
with regards
Bikramhi maskey,
thanks for your reply, i have got the solution, the problem is due to the use same object in two different fields. i got the solutions.
regards
Bikram -
Hello,Team
I want to use CFL (object-id =171 emp details) in matrix column.
It is not getting copied values from CFL into matrix cell i used to do in normal textbox(not in matrix) but i dont know how to do with matrix
i trie like this.
If oCFL.UniqueID = "EMP" Then
oDH.setvalue ("U_Name", 0,oDT.GetValue("lastName", 0))
but not working
In normal text box this code is working.
By
Firos.C
Edited by: firoz101 on Jul 31, 2009 11:28 AM
Edited by: firoz101 on Jul 31, 2009 11:29 AMFiroz
after setting the data to dbdatasource, call a SetLineData() or LoadFromDataSource() method for the matrix object.
Anoop -
CFL in matrix + manual values adding
Hi experts
I've got a matrix with CFL column. I can choose items via CFL but I would also like to write an item index manually. When I do so and press TAB I cannot lost focus on particular cell in the column, beacuse the program does not recognize the index. I bind the column with DBDataSource.
Shall I change sth in CFL creation parameters or do what?
Thanks in advanceWell it works with any item in the form, but when it comes to matrix it doesn't.
I must bind column with DbDataSource and maybe that's the reason. However I cannot bind it with userdatasource, beacuse then I cannot change once written value - the source stays with 1st version.
So I suppose DBdatasource is necessary, though as I mentioned I cannot put values manually then.
Am I doing something wrong or what? -
Copied down row entries by CFL in Matrix
hello expert
i created one form which have one matrix and one add row button.matrix have three colum like name,lname and age.name colum have CFL.when i added one then one more row and selected contend of cfl in it work fine but after adding two row when i go to change the content of first row by cfl . its copied the entries of down row not select the coosing entries .pls help me sir
thanx a lotHello expert
for CFL i used this coading
If oCFL.UniqueID = "CFL_17" Then
Dim i As Integer
Dim j As Integer
Dim val1 As String
Dim val2 As String
Dim val3, val4 As String
Dim val5 As Integer
Dim oRecordSet As SAPbobsCOM.Recordset = objMain.objCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
oMatrix = oForm.Items.Item("orad1").Specific
val1 = oDataTable.GetValue("Code", 0)
val2 = oDataTable.GetValue("U_TName", 0)
val3 = oDataTable.GetValue("U_TName", 0)
val4 = oDataTable.GetValue("U_TType", 0)
val5 = 1
For i = 0 To oDataTable.Rows.Count - 1
oMatrix.FlushToDataSource()
oForm.DataSources.DBDataSources.Add("@PACK8")
oForm.DataSources.DBDataSources.Item("@PACK8").SetValue("U_IRid", pVal.Row - 1, val1)
oForm.DataSources.DBDataSources.Item("@PACK8").SetValue("U_IRName", pVal.Row - 1, val2.ToString.Trim())
oForm.DataSources.DBDataSources.Item("@PACK8").SetValue("U_IRDesc", pVal.Row - 1, val3.ToString.Trim())
oForm.DataSources.DBDataSources.Item("@PACK8").SetValue("U_IRType", pVal.Row - 1, val4.ToString.Trim())
oForm.DataSources.DBDataSources.Item("@PACK8").SetValue("U_Qty", pVal.Row - 1, val5)
Dim RS As SAPbobsCOM.Recordset
RS = objMain.objCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
RS.DoQuery("Select T2.ListName,T0.PriceList,T0.Price from ITM1 T0,OITM T1,OPLN T2 where T0.ItemCode = T1.ItemCode and T2.BASE_NUM=T0.PriceList and T1.ItemName='" & val4 & "' ")
RS.MoveFirst()
If (colItemRPriceList.ValidValues.Count <= 0) Then
While RS.EoF = False
Dim a, b As String
a = RS.Fields.Item("PriceList").Value
b = RS.Fields.Item("Price").Value
colItemRPriceList.ValidValues.Add(RS.Fields.Item("ListName").Value, RS.Fields.Item("Price").Value)
'colItemPriceList.Columns.Item("V_7").Cells.Item(pVal.Row).Specific.ValidValues.Add(RS.Fields.Item("PriceList").Value, RS.Fields.Item("Price").Value)
RS.MoveNext()
End While
End If
oMatrix.LoadFromDataSource()
oMatrix.SetLineData(pVal.Row)
If Not i = oDataTable.Rows.Count - 1 Then
oMatrix.AddRow()
End If
Next
End If -
hi friends
i had created a form with a matrix and an editbox. i can apply the cfl for the editbox but i cant use the same for the first column of the matrix...can anyone provide any sample coding for this process
thanks and regards
manoj nagarajHi
Look this. I think this code is complete.
Best regards
Sierdna S.
Public Sub SBO_CreateForm(...)
'... add controls to form, matrix, matrix columns,...
Call AddChooseFromList(oForm)
oForm.Visible = True
End Sub
Private Sub AddChooseFromList(ByRef oForm As SAPbouiCOM.Form)
Try
Dim oCFLs As SAPbouiCOM.ChooseFromListCollection
Dim oCons As SAPbouiCOM.Conditions
Dim oCon As SAPbouiCOM.Condition
oCFLs = oForm.ChooseFromLists
Dim oCFL As SAPbouiCOM.ChooseFromList
Dim oCFLCreationParams As SAPbouiCOM.ChooseFromListCreationParams
oCFLCreationParams = SBO_Application.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_ChooseFromListCreationParams)
' CFL for Items ------------------------------
oCFLCreationParams.MultiSelection = False
oCFLCreationParams.ObjectType = 4
' Item Code
oCFLCreationParams.UniqueID = "cflIC"
oCFL = oCFLs.Add(oCFLCreationParams)
oCons = oCFL.GetConditions()
oCon = oCons.Add()
' Item Name
oCFLCreationParams.UniqueID = "cflIN"
oCFL = oCFLs.Add(oCFLCreationParams)
oCons = oCFL.GetConditions()
oCon = oCons.Add()
' CFL button
oCFLCreationParams.UniqueID = "cflIB"
oCFL = oCFLs.Add(oCFLCreationParams)
oCons = oCFL.GetConditions()
oCon = oCons.Add()
Catch ex As Exception
' log exception
Finally
System.GC.Collect() 'Release the handle to the table
End Try
End Function
Public Sub ManageItemEvent(ByVal FormUID As String, ByRef pVal As SAPbouiCOM.ItemEvent, ByRef BubbleEvent As Boolean)
Dim oForm As SAPbouiCOM.Form
oForm = SBO_Application.Forms.Item(FormUID)
Select Case pVal.EventType
Case BoEventTypes.et_CHOOSE_FROM_LIST
If Not pVal.BeforeAction Then
Dim oCFLEvento As SAPbouiCOM.IChooseFromListEvent
oCFLEvento = pVal
Dim sCFL_ID As String
sCFL_ID = oCFLEvento.ChooseFromListUID
Dim oCFL As SAPbouiCOM.ChooseFromList
oCFL = oForm.ChooseFromLists.Item(sCFL_ID)
Dim oDataTable As SAPbouiCOM.DataTable
oDataTable = oCFLEvento.SelectedObjects
Dim sCode As String = ""
Dim sName As String = ""
Try
sCode = oDataTable.GetValue(0, 0) ' Code
sName = oDataTable.GetValue(1, 0) ' Name
Catch ex As Exception
sCode = ""
sName = ""
' log exception
End Try
' Rows
If (pVal.ColUID = "colICode") Or (pVal.ColUID = "colIName") Then
oForm.DataSources.DBDataSources.Item("@USER_TABLE").SetValue("U_ItemCode", pVal.Row, sCode)
oForm.DataSources.DBDataSources.Item("@USER_TABLE").SetValue("U_ItemName", pVal.Row, sName)
Call UpdateCells(oForm, pVal.Row, sCode, sName)
End If
End If
End Select
oForm = Nothing
End Sub
Private Function UpdateCells(ByRef oForm As SAPbouiCOM.Form, ByVal iRow As Integer, _
ByVal sCode As String, ByVal sName As String) As Boolean
Dim b As Boolean = True
Try
Dim oMatrix As SAPbouiCOM.Matrix
Dim oColumn As SAPbouiCOM.Column
Dim oCell As SAPbouiCOM.Cell
Dim oEdit As SAPbouiCOM.EditText
' MatrixID
oMatrix = oForm.Items.Item(MatrixID).Specific
oColumn = oMatrix.Columns.Item("colICode")
oCell = oColumn.Cells.Item(iRow)
oEdit = oCell.Specific
oEdit.String = sCode
oColumn = Nothing
oCell = Nothing
oEdit = Nothing
oColumn = oMatrix.Columns.Item("colIName")
oCell = oColumn.Cells.Item(iRow)
oEdit = oCell.Specific
oEdit.String = sName
oColumn = Nothing
oCell = Nothing
oEdit = Nothing
oMatrix = Nothing
Catch ex As Exception
b = False
' log exception
Finally
System.GC.Collect() 'Release the handle to the table
End Try
Return b
End Function -
Hi All,
In my addon i hava a matix.In that first column when i press tab a list of items window should be get opened(from ITEM MASTER DATA) in a CFL,can anybody suggest me some coding for this????
regards,
shangai.Hi
oForm.Freeze(True)
Dim cflevent As SAPbouiCOM.ChooseFromListEvent = pVal
Dim oCFLEvento As SAPbouiCOM.ChooseFromList
Dim strUid As String = cflevent.ChooseFromListUID
oCFLEvento = oForm.ChooseFromLists.Item(strUid)
Dim oDataTable As SAPbouiCOM.DataTable = cflevent.SelectedObjects
Try
If strUid = CFL1 Then
Try
oMatrix.Columns.Item("col0").Cells.Item(pVal.Row).Specific.string = oDataTable.GetValue(0, 0)
Catch ex As Exception
End Try
End If
Thanks.. -
CFL in matrix columns for A/R Invoice
Hi experts,
This my xml form code.
Can someone show me where i have done an error. I have 2 CFL on 2 columns
Regards.
Edited by: Olivier KPOLO on Apr 1, 2010 12:51 PMHello freind where is xml code and what is problem
-
hi all good morning.... i have one problem i assigned query cfl for matrix field. the value fetch based on header level.... the query fetch the data but its not show the CFL window..here i pasted my code
Case "matvariant"
Select Case pVal.ColUID
Case "Col_Colour"
Select Case pVal.EventType
Case SAPbouiCOM.BoEventTypes.et_GOT_FOCUS
Dim oForm As SAPbouiCOM.Form = gonAppApplication.Forms.Item("VARAINT")
Dim sQuery As String = "SELECT T1.[U_U_COLOR] FROM [dbo].[@ITEMCOLOR_DETAIL] T0 inner join [dbo].[@ITEMCOLOR_HEADER] T1 on t0.docentry=t1.docentry WHERE T0.[U_Itmcode] !='' and T0.[U_Avail] ='y' and T0.[U_Itmcode] = '" & oForm.Items.Item("txticode").Specific.Value & "'"
oGeneral.SetConditionToCFL1(oForm, "COLITEMCFL1", "U_ID", sQuery)
Case SAPbouiCOM.BoEventTypes.et_CHOOSE_FROM_LIST
Dim bonCflEvents As SAPbouiCOM.ChooseFromListEvent
Dim bonDTTable As SAPbouiCOM.DataTable
Dim bonCflList As SAPbouiCOM.ChooseFromList
Dim bnnstrUID As String
bonCflEvents = pVal
bnnstrUID = bonCflEvents.ChooseFromListUID
bonDTTable = bonCflEvents.SelectedObjects
bonCflList = lonConvForm.ChooseFromLists.Item(bnnstrUID)
If Not (bonDTTable Is Nothing) Then
If bonCflList.UniqueID = "COLITEMCFL1" Then
gonMatConvMatrix.GetLineData(pVal.Row)
gonMatConvMatrix.GetLineData(pVal.Row)
lonDetailDatasource.SetValue("U_Col_COLOR", lonDetailDatasource.Offset, bonDTTable.GetValue("U_COLOR_NAME", 0))
gonMatConvMatrix.SetLineData(pVal.Row)
If pVal.Row = gonMatConvMatrix.VisualRowCount Then
lonDetailDatasource.SetValue("U_Col_COLOR", lonDetailDatasource.Offset, "")
lonDetailDatasource.SetValue("U_Col_LENGTH", lonDetailDatasource.Offset, "")
lonDetailDatasource.SetValue("U_Col_WIDTH", lonDetailDatasource.Offset, "")
lonDetailDatasource.SetValue("U_Col_THICK", lonDetailDatasource.Offset, "")
lonDetailDatasource.SetValue("U_Col_SIZE", lonDetailDatasource.Offset, "")
lonDetailDatasource.SetValue("U_Col_Desc", lonDetailDatasource.Offset, "")
lonDetailDatasource.SetValue("U_Col_Price", lonDetailDatasource.Offset, "")
lonDetailDatasource.SetValue("LineId", lonDetailDatasource.Offset, pVal.Row + 1)
gonMatConvMatrix.AddRow()
gonMatConvMatrix.SetLineData(pVal.Row + 1)
gonMatConvMatrix.FlushToDataSource()
End If
Else
End If
End If
End Select
End Select
Edited by: narain.balan on Oct 26, 2010 7:02 AMHi
Please post the function code oGeneral.SetConditionToCFL1(oForm, "COLITEMCFL1", "U_ID", sQuery)
I think the problem is with choose from list condition.
Regards
Arun -
[no replies since 2days] problem when doing line total in matrix?
hi everyone...
i have a user form in which ihave a matrix with few columns and for a particular column there is CFL...when i select a CFL my matrix is feeding with data in other columns as well.....
in my form there is a edit box called Tax...in to which iam supposed to calculate the line total of a column in my matrix... as soon as when i enter CFL....
here is the code which i have written in item event
oMatrix2.FlushToDataSource()
oDBDataSource6.SetValue("U_Tax", pVal.Row - 1, oCFLEvent.SelectedObjects.GetValue(0, 0))
oDBDataSource6.SetValue("U_Tax_Amount", pVal.Row - 1, oCFLEvent.SelectedObjects.GetValue(2, 0))
oMatrix2.LoadFromDataSource()
oMatrix2.Columns.Item("V_7").Cells.Item(pVal.Row).Click(SAPbouiCOM.BoCellClickType.ct_Regular)
''for Tax
taxTotal = oForm.Items.Item("33").Specific.value
taxAmount = oMatrix2.Columns.Item("V_7").Cells.Item(pVal.Row).Specific.value
tax = taxTotal + taxAmount
oForm.Items.Item("33").Specific.value = tax
'' end for Tax
the above is code is working perfect...but,
there are 2 problems....
1. if i remove "oMatrix2.Columns.Item("V_7").Cells.Item(pVal.Row).Click(SAPbouiCOM.BoCellClickType.ct_Regular)" line from my code there is an error called
" Application has a problem. Diagnostic file C:
some path..dump was created...plz attach the file...etc etc..."
2. in my matrix column if i re-enter any other CFL data...my Tax is adding again with same value again...i.e i'm not getting the correct line total...
plz provide me the solution for both the questions...
thanks in advance
Edited by: Shenaz Sultana on Jan 7, 2010 12:29 PMHi,
For your 1st question, y should you remove that line? If it works fine with that line, leave it as it is. Its afterall placing the focus in that column right?
w.r.t your 2nd question, the reason why the same value is being considered for tax calculation is that, the same old datasource is not cleared. So you clear the datasource manually and this problem will be solved.
Eg: Try to clear the data source as below.
oForm.DataSources.DBDataSources.Item("@Table_Name").Clear();
Hope this helps.
Regards,
Satish. -
Choose from List in A matrix for choosing two or more rows at same time
Hi Friends,
Actually I m using choose from list to select Items in a row, i can select Two or more rows from the List but while clicking choose it is taking only one value.
The no of rows are not activated tat i m choosing from list.
Thanks in advance
VivekHi.
Here is a [link|https://forums.sdn.sap.com/click.jspa?searchID=12829558&messageID=5584893] where are you can find on of my example on CFL on matrix column.
I think, you need to made some changes in code from these lines...
Dim oDataTable As SAPbouiCOM.DataTable
oDataTable = oCFLEvento.SelectedObjects
for ...
end for
Reply if this guideline was usefull for you.
Bye -
Error in Choose from list on Matrix
Hi all,
I am using CFL in matrix for my user define form, When i choose a value from CFL , i am getting the following error
<b>" Item -Can't set value on item because the item can't get focus [66000-153]"</b>
<u>the code i used is given below</u>
<u>this is in Item Event</u>
Try
If FormUID = ("FRMIGRP") Then
If pVal.Before_Action = False Then
If (pVal.EventType = SAPbouiCOM.BoEventTypes.et_CHOOSE_FROM_LIST) Then
' If pVal.EventType = SAPbouiCOM.BoEventTypes.et_GOT_FOCUS Then
Dim oCFLEvento As SAPbouiCOM.IChooseFromListEvent
oCFLEvento = pVal
Dim sCFL_ID As String
sCFL_ID = oCFLEvento.ChooseFromListUID
Dim oForm As SAPbouiCOM.Form
oForm = SBO_Application.Forms.Item(FormUID)
Dim oCFL As SAPbouiCOM.ChooseFromList
oCFL = oForm.ChooseFromLists.Item(sCFL_ID)
If oCFLEvento.BeforeAction = False Then
Dim oDataTable As SAPbouiCOM.DataTable
oDataTable = oCFLEvento.SelectedObjects
Dim val As String
Dim val1 As String
Dim val2 As String
Dim val3 As String
Try
val = oDataTable.GetValue(0, 0)
val1 = oDataTable.GetValue(1, 0)
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
Try
If (pVal.ItemUID = "txtcode") Then
Dim oDS As SAPbouiCOM.DBDataSource
oDS = oForm.DataSources.DBDataSources.Item("@PSSIT_GRPHDR") 'add your dbdatasource here
oDS.SetValue("U_grpcode", oDS.Offset, val) ' val1 is the value you are setting
oDS.SetValue("U_grpname", oDS.Offset, val1)
End If
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
Try
val2 = oDataTable.GetValue(0, 0)
val3 = oDataTable.GetValue(1, 0)
If (pVal.ItemUID = "matr") And (pVal.ColUID = "supp") Then
Dim oEdit As SAPbouiCOM.EditText
oMatrix.FlushToDataSource()
oForm.DataSources.UserDataSources.Item("EditDS2").ValueEx = val2.ToString
oEdit = subcol.Cells.Item(pVal.Row).Specific
oEdit.Value = val2.ToString
oEdit = subname.Cells.Item(pVal.Row).Specific
oEdit.Value = val3.ToString
("EditDS2").ValueEx = Nothing
End If
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End If
And i used data source also to set the value using below code, but for that also value is not set in to the field
Dim oEdit As SAPbouiCOM.EditText
Dim oDS As SAPbouiCOM.DBDataSource
oDS = oForm.DataSources.DBDataSources.Item("@PSSIT_GRPDTL") 'add your dbdatasource here
oDS.SetValue("U_supcode", oDS.Offset, val2) ' val1 is the value you are setting
oDS.SetValue("U_supname", oDS.Offset, val3)
SOmebody can help me to solve this issue
Regards
Suresh RSuresh,
Try this one,
Here i have used for check the dulpicate entry also, that is if we choose one item in the first row in second row or third we cant able to choose the same. If u no need just neglect it.
Case SAPbouiCOM.BoEventTypes.et_CHOOSE_FROM_LIST And pVal.BeforeAction = False
Dim oCFLE As SAPbouiCOM.IChooseFromListEvent
oCFLE = pVal
Dim CFLID As String
CFLID = oCFLE.ChooseFromListUID
PI_Frm = app.Forms.Item(FormUID)
Dim oCFL As SAPbouiCOM.ChooseFromList
oCFL = PI_Frm.ChooseFromLists.Item(CFLID)
oCFL.UniqueID = "CFL2" Then
Dim oDT As SAPbouiCOM.DataTable
oDT = oCFLE.SelectedObjects
Try
Dim oMat As SAPbouiCOM.Matrix
Dim t, t1 As String
Dim Rec, Rec1, Rec2 As SAPbobsCOM.Recordset
oMat = PI_Frm.Items.Item("m_det").Specific
t = oDT.GetValue(0, 0)
t1 = oDT.GetValue(1, 0)
If Trim(HEAD_oDBds.GetValue("U_pid", 0)).Equals("") = False Then
oMat.Columns.Item("rate").Editable = False
Else
oMat.Columns.Item("rate").Editable = True
End If
Dim Bool As Boolean = False
For i As Integer = 1 To oMat.VisualRowCount
oMat.GetLineData(i)
If Trim(DETAIL_oDBds.GetValue("U_itno", (i - 1))).Equals(Trim(oDT.GetValue(0, 0))) = True Then
Bool = False
Exit For
Else
Bool = True
End If
Next
If Bool = True Then
If pVal.Row = oMat.VisualRowCount Then
oMat.AddRow()
oMat.FlushToDataSource()
Me.SetEmptyRow(DETAIL_oDBds.Size)
End If
Rec = com.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
Rec1 = com.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
Rec2 = com.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
Rec.DoQuery("select BuyUnitMsr from OITM where ItemCode ='" & Trim(oDT.GetValue(0, 0)) & "'")
DETAIL_oDBds.Offset = (pVal.Row - 1)
DETAIL_oDBds.SetValue("LineId", DETAIL_oDBds.Offset, pVal.Row)
DETAIL_oDBds.SetValue("U_itno", DETAIL_oDBds.Offset, oDT.GetValue(0, 0))
DETAIL_oDBds.SetValue("U_itdesc", DETAIL_oDBds.Offset, oDT.GetValue(1, 0))
DETAIL_oDBds.SetValue("U_unit", DETAIL_oDBds.Offset, Rec.Fields.Item(0).Value)
DETAIL_oDBds.SetValue("U_poqty", DETAIL_oDBds.Offset, "0")
DETAIL_oDBds.SetValue("U_qnos", DETAIL_oDBds.Offset, "0")
DETAIL_oDBds.SetValue("U_pur", DETAIL_oDBds.Offset, "")
Rec1.DoQuery("select U_basicrate from [@RATE_MASTER_DETAIL] where U_itemid='" & oDT.GetValue(0, 0) & "'")
DETAIL_oDBds.SetValue("U_rate", DETAIL_oDBds.Offset, Rec1.Fields.Item(0).Value)
Rec2.DoQuery("select a.OnHand ,b.ItemCode,b.DfltWH,a.WhsCode from OITW a,OITM b where a.ItemCode=b.ItemCode and b.DfltWH=a.WhsCode and b.DfltWH='01' and b.ItemCode='" & oDT.GetValue(0, 0) & "'")
DETAIL_oDBds.SetValue("U_stx", DETAIL_oDBds.Offset, Rec2.Fields.Item(0).Value)
oMat.SetLineData(pVal.Row)
End If
If it helps give me reward points.
Regards,
Anitha -
hi friends
i have a doubt . can i create two cfl in the same form? if so how?
thanks and regards
Manoj NagarajHi,
Yes, you can create more CFLs with own UniqueID on the same form.
In manage item event handler you can filter by uid of CFL.
An example of CFLs on Clients Orders form:
<ChooseFromListCollection>
<action type="add">
<ChooseFromList UniqueID="-1" ObjectType="17" MultiSelection="0" IsSystem="1" />
<ChooseFromList UniqueID="1" ObjectType="73" MultiSelection="0" IsSystem="1" />
<ChooseFromList UniqueID="10" ObjectType="1" MultiSelection="0" IsSystem="1" />
<ChooseFromList UniqueID="11" ObjectType="1" MultiSelection="0" IsSystem="1" />
<ChooseFromList UniqueID="12" ObjectType="17" MultiSelection="0" IsSystem="1" />
</action>
</ChooseFromListCollection>
It is possible to find many examples by searching on SDK forum for words "CFL" or "ChooseFromList".
When you create form call this function to add cfls
Private Function AddChooseFromList(ByRef oForm As SAPbouiCOM.Form) As Boolean
Dim b As Boolean = True
Try
Dim oCFLs As SAPbouiCOM.ChooseFromListCollection
Dim oCons As SAPbouiCOM.Conditions
Dim oCon As SAPbouiCOM.Condition
oCFLs = oForm.ChooseFromLists
Dim oCFL As SAPbouiCOM.ChooseFromList
Dim oCFLCreationParams As SAPbouiCOM.ChooseFromListCreationParams
oCFLCreationParams = SBO_Application.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_ChooseFromListCreationParams)
' Agent CFL
oCFLCreationParams.MultiSelection = False
oCFLCreationParams.ObjectType = 53
' Agent Code
oCFLCreationParams.UniqueID = "cflACode"
oCFL = oCFLs.Add(oCFLCreationParams)
oCons = oCFL.GetConditions()
oCon = oCons.Add()
' Agent Name
oCFLCreationParams.UniqueID = "cflAName"
oCFL = oCFLs.Add(oCFLCreationParams)
oCons = oCFL.GetConditions()
oCon = oCons.Add()
' Agent: Button CFL
oCFLCreationParams.UniqueID = "cflAButt"
oCFL = oCFLs.Add(oCFLCreationParams)
oCons = oCFL.GetConditions()
oCon = oCons.Add()
' Business Partner CFL
oCFLCreationParams.MultiSelection = False
oCFLCreationParams.ObjectType = 2
' BP Code
oCFLCreationParams.UniqueID = "cflBPCode"
oCFL = oCFLs.Add(oCFLCreationParams)
oCons = oCFL.GetConditions()
oCon = oCons.Add()
' BP Name
oCFLCreationParams.UniqueID = "cflBPName"
oCFL = oCFLs.Add(oCFLCreationParams)
oCons = oCFL.GetConditions()
oCon = oCons.Add()
' BP Button for CFL
oCFLCreationParams.UniqueID = "cflBPButt"
oCFL = oCFLs.Add(oCFLCreationParams)
oCons = oCFL.GetConditions()
oCon = oCons.Add()
Catch ex As Exception
b = False
' log exception
Finally
System.GC.Collect() 'Release the handle to the table
End Try
Return b
End Function
If you about CFL on matrix... in manage Item event check CFL UniqueID...
Case BoEventTypes.et_CHOOSE_FROM_LIST
If Not pVal.BeforeAction _
And (pVal.ColUID = "colICode" Or pVal.ColUID = "colIName") Then
Dim oCFLEvento As SAPbouiCOM.IChooseFromListEvent
oCFLEvento = pVal
Dim sChooseFromListUID As String
sChooseFromListUID = oCFLEvento.ChooseFromListUID
Dim oChooseFromList As SAPbouiCOM.ChooseFromList
oChooseFromList = oForm.ChooseFromLists.Item(sChooseFromListUID)
Dim oDataTable As SAPbouiCOM.DataTable
oDataTable = oCFLEvento.SelectedObjects
Dim sCode As String = ""
Dim sName As String = ""
Try
sCode = oDataTable.GetValue(0, 0)
sName = oDataTable.GetValue(1, 0)
Catch ex As Exception
' log exception
sCode = ""
sName = ""
End Try
If Not sCode.Equals("") Then
' IF MATRIX COLUMN
' Update Matrix Row:
' 1) oForm to have oMatrix object;
' 2) row, to know where are need to be writed the Code & Name values.
b = MatrixUpdateCell(oForm, pVal.Row, sCode, sName)
' IF DBDATASOURCES
oForm.DataSources.DBDataSources.Item("USER_TABLE").SetValue("Code", 0, sCode)
oForm.DataSources.DBDataSources.Item("USER_TABLE").SetValue("Name", 0, sName)
End If
End If
Or search DK forum for "CFL matrix" words.
Also look this
Case SAPbouiCOM.BoEventTypes.et_CHOOSE_FROM_LIST
If Not pVal.BeforeAction Then
Try
oForm.Freeze(True)
Dim oCFLEvento As SAPbouiCOM.IChooseFromListEvent
oCFLEvento = pVal
Dim sCFL_UID As String
sCFL_UID = oCFLEvento.ChooseFromListUID
Select Case sCFL_UID
Case "cfl1"
Dim oCFL As SAPbouiCOM.ChooseFromList
oCFL = oForm.ChooseFromLists.Item(sCFL_UID)
If oCFLEvento.BeforeAction = False Then
Dim oDataTable As SAPbouiCOM.DataTable
oDataTable = oCFLEvento.SelectedObjects
Dim valCode As String = ""
Dim valName As String = ""
Try
valCode = oDataTable.GetValue(0, 0)
valName = oDataTable.GetValue(1, 0)
Catch ex As Exception
' log exception
End Try
Try
If (pVal.ItemUID = "eBPCode") Or (pVal.ItemUID = "bCFL1") Then
' for userdatasource
oForm.DataSources.UserDataSources.Item("uCardName").ValueEx = valName
' for dbdatasource
oForm.DataSources.DBDataSources.Item("USER_DEF_TABLE").SetValue("U_DEFINED_FIELD", 0, valCode)
' form to update mode
oForm.Mode = SAPbouiCOM.BoFormMode.fm_UPDATE_MODE
End If
Catch ex As Exception
Dim s As String = ex.Message
End Try
End If
Case "cfl2"
' do something
Case "cfl3"
' do something
End Select
Catch ex As Exception
' log exception
Finally
oForm.Freeze(False)
End Try
End If
Hope I help you.
Regards
Sierdnas
Edited by: Sierdna S on Jul 17, 2008 12:04 PM -
Hi,All
I have created a master data and i registered object of it. Now in find-mode i am able to get CFL of that master data.
Also i m assiging that CFL vale into some other form. it's working fine
But my problem is im assiging my CFL into matrix cell of type (LinkButton). Once i click link button i want to see my master data
w r to record. But while clicking link button it is not showing anything.
Object id of CFL is TAB_PRB (registere with this name)
By
Firos.CHi Firoz,
If you are loading your form and not SAP B1 default forms, then I can suggest a work around for you. On the click of the link button, you can the LoadForm function for that particular form .SRF or .XML w.r.t the corresponding doc number of that UDF.
Hope this helps.
Best Regards,
Satish. B.
Maybe you are looking for
-
Mail accounts - how to make IMAP
I have a Gmail account that I want to access with Apple Mail, and it can be accessed as a POP or an IMAP server. Iwish to use imap. But the account creation process gives me no choice, and makes it a POP account. How can I create an email account in
-
I am trying to joint four different clips created on a Flip portable video camera. I have tried this both and iMovie and iDVD And after reading other posts, I understand that you have to use either QuickTime or iMovie to join them together and bring
-
Just switched from Windows XP to iMac and had all my hard drive docs, pics, etc. transfered. But I can't print any of the docs, only e-mails and pics. And I can't print pages from recently installed Final Draft. Why? Also, why is the text on iMac so
-
Session issues. (IE7)
Hi all, I got two bothering questions and I hope someone knows the answer(s): 1. I implemented session listener and when I close the browser the destroy method not invoke, what can be wrong? 2. When I open new tabs in IE7 the session is duplicated in
-
I am running Win7. On my screen, there is a field that lists the browsers available. The default seems to be Ask with the others listed, about 5. There is a button to move them according to preference so I move Google up to the top. Then there is als