Itemcode CFL condition
Hi,
When we type in Itemcode column of any document like Purchase Order, Invoice etc. then as we type SAP gives us list of Itemcode matching the value we have typed. This list is shown just below the Itemcode. Please check attachment image for reference.
Can we put conditions to select Itemcode in that list? I am able to aplly condition on CFL but I am not getting how to capture list ID.
In Event logger, it shows that this is a CFL.
Any idea??
Regards,
Amrut Sabnis
Hi Amrut,
That list is actually generated by the 'SAP Business One Suggest' function. You can turn this on or off from within General Settings (Display tab). Unfortunately, I don't believe this feature is currently exposed to the UI API so you can't manipulate it through code. There is a CFL linked to the same field but the CFL and the Suggest list are not linked.
If you turn off the Suggest feature then you could either use your own formatted search on the same field to show a custom list of items or potentially use the UI API to filter the CFL list when it opens.
Kind Regards,
Owen
Similar Messages
-
Hi ,
in my addon SRF Form i have two Edit text box(item Group, Item)
with respect to item group(CFL) selection , i will change the CFL condition of item selection CFL. dyanmically.
first time its working fine. second time item CFL is Empty.
tihs is my sample code:
If pVal.EventType = SAPbouiCOM.BoEventTypes.et_CHOOSE_FROM_LIST Then
If pVal.ItemUID = "item edit txt" And pVal.FormUID.StartsWith("FormUid") Then
Dim val As String = oForm.Items.Item("GrpEditid").Specific.value
Dim RsGrp As SAPbobsCOM.Recordset = ocompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
RsGrp.DoQuery("Select ItmsGrpCod From .[OITB] ItmsGrpNam = '" & val & "'")
Dim oCFLs As SAPbouiCOM.ChooseFromListCollection = oForm.ChooseFromLists
oCFL = oCFLs.Item("CFL_3")
oCons = oForm.ChooseFromLists.Item("CFL_3").GetConditions
' oCons = oCFL.GetConditions()
oCon = oCons.Add()
oCon.Alias = "ItmsGrpCod"
oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL
oCon.CondVal = Integer.Parse(RsGrp.Fields.Item(0).Value)
oForm.ChooseFromLists.Item("CFL_3").SetConditions(oCons)
End if
am getting oCon.CondVal correctly every time..
But CFL is empty..
Any Suggestion??
regards,
Ganesh kI can suggest you this:
- Use breackpoints to see oCon.CondVal.
- Try to set conditions to nothing.
If pVal.EventType = SAPbouiCOM.BoEventTypes.et_CHOOSE_FROM_LIST Then
If pVal.ItemUID = "item edit txt" And pVal.FormUID.StartsWith("FormUid") Then
Dim val As String = oForm.Items.Item("GrpEditid").Specific.value
Dim RsGrp As SAPbobsCOM.Recordset = ocompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
RsGrp.DoQuery("Select ItmsGrpCod From .OITB ItmsGrpNam = '" & val & "'")
Dim oCFLs As SAPbouiCOM.ChooseFromListCollection = oForm.ChooseFromLists
oCFL = oCFLs.Item("CFL_3")
' +++++++++++++++++++++++++++++++++++++++++++++
oCFL.SetConditions(Nothing)
' +++++++++++++++++++++++++++++++++++++++++++++
oCons = oForm.ChooseFromLists.Item("CFL_3").GetConditions
' oCons = oCFL.GetConditions()
oCon = oCons.Add()
oCon.Alias = "ItmsGrpCod"
oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL
oCon.CondVal = Integer.Parse(RsGrp.Fields.Item(0).Value)
oForm.ChooseFromLists.Item("CFL_3").SetConditions(oCons)
End if
End if
An working example.
Here I update CFL conditions in base on combobox choise.
Private Sub CFL_UpdateConditions(ByRef oForm As SAPbouiCOM.Form)
Dim oCFLs As SAPbouiCOM.ChooseFromListCollection
Dim oCons As SAPbouiCOM.Conditions
Dim oCon As SAPbouiCOM.Condition
Dim oCombo As SAPbouiCOM.ComboBox
Dim sType As String = ""
Try
oCombo = oForm.Items.Item("eType").Specific
If Not oCombo.Selected.Value Is Nothing Then
sType = oCombo.Selected.Value
End If
Catch ex As Exception
' log exception
End Try
Try
oCFLs = oForm.ChooseFromLists
For Each oCFL As SAPbouiCOM.ChooseFromList In oCFLs
If oCFL.UniqueID.Equals("1") Or oCFL.UniqueID.Equals("0") Then
' +++++
oCFL.SetConditions(Nothing)
' +++++
' Adding Conditions to CFL1
oCons = oCFL.GetConditions()
' Condition 1: CardType = "C"
oCon = oCons.Add()
oCon.Alias = "CardType"
oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL
oCon.CondVal = "S"
' ... AND ...
oCon.Relationship = SAPbouiCOM.BoConditionRelationship.cr_AND
' Condition 2: U_Type IS NULL or EQUAL to sType
oCon = oCons.Add
oCon.Alias = "U_Type"
'oCon.Operation = SAPbouiCOM.BoConditionOperation.co_IS_NULL
oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL
oCon.CondVal = sType.Trim
' Set conditions for CFL
oCFL.SetConditions(oCons)
End If
Next
Catch ex As Exception
' log exception
Finally
oCon = Nothing
oCons = Nothing
oCFLs = Nothing
End Try
End Sub -
Delete/Edit/Update CFL Conditions - Choose From List
Hi All,
I have a Choose From List of which the conditions are set depending on a ComboBox.Selected.Value
oCon.CondVal = comboboxBranch.Selected.Value
So the Conditions are set when the "OnAfterComboSelect" event is trigered.
How do I reset the Condition when the user "RESELECTS" another ValidValue on that ComboBox???
At the moment, on the Reselection on the Combobox, the CFL is returning EMPTY.....
ThanksHi Michael,
Thanks for the speedy reply. Its workin.
Here's my code for the adding/editing of the Conditions from within the an Event Handler if any1 needs it.
In the OnAfterFormLoad Event Handler:
Dim oCFLs As SAPbouiCOM.ChooseFromListCollection
Dim oCFL As SAPbouiCOM.ChooseFromList
Dim oCons As SAPbouiCOM.Conditions
Dim oCon As SAPbouiCOM.Condition
Dim oCFLCreationParams As SAPbouiCOM.ChooseFromListCreationParams
' Adding CFL3 for Line GL Account Name.
oCFLCreationParams.MultiSelection = False
oCFLCreationParams.ObjectType = "1"
oCFLCreationParams.UniqueID = "CFL3"
oCFL = oCFLs.Add(oCFLCreationParams)
In the 1st TabOrder Item's OnGotFocus Event Handler:
oColumn = oColumns.Item("AcctCode")
oColumn.ChooseFromListUID = "CFL3"
oColumn.ChooseFromListAlias = "FormatCode"
In the OnAfterComboSelect Event Handler:
oCFLs = form.ChooseFromLists
oCFL = oCFLs.Item("CFL3")
oCons = oCFL.GetConditions()
If oCons.Count = 0 Then
oCon = oCons.Add()
oCon.BracketOpenNum = 2
oCon.Alias = "GroupMask"
oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL
oCon.CondVal = "7"
oCon.BracketCloseNum = 1
oCon.Relationship = BoConditionRelationship.cr_AND
oCon = oCons.Add()
oCon.BracketOpenNum = 1
oCon.Alias = "Postable"
oCon.Operation = BoConditionOperation.co_EQUAL
oCon.CondVal = "Y"
oCon.BracketCloseNum = 1
oCon.Relationship = BoConditionRelationship.cr_AND
oCon = oCons.Add()
oCon.BracketOpenNum = 1
oCon.Alias = "Segment_1"
oCon.Operation = BoConditionOperation.co_EQUAL
oCon.CondVal = comboboxBranch.Selected.Value
oCon.BracketCloseNum = 2
oCFL.SetConditions(oCons)
Else
oCon = oCons.Item(2)
oCon.CondVal = comboboxBranch.Selected.Value
oCFL.SetConditions(oCons)
End If -
Condition Specific or attach query with chose from list
Hi All,
I have developed a form with the header containing the Customer Code and Name and the Rows containing columns like SO Number, Item Code, Item Name and Quantity.
The SO Number field has a chose from list and I want that this will show only the Open Sales orders for the customer selected in the header CUSTOMER CODE field of the form.
Similarly The ITEM CODE choose from List will only show the items in that particular selected Sales Order in the first column of that row.
This is very much being possible through formatted search attached. But I wish if this can be done by adding condition or query to the choose from list. Please help me in this regards with your suggestions.
Please provide a sample code if any has already done something like this.
Regards,
RajHi,
U can use a CFL with conditions. So when u tab out u can get only the required records.
Check out the below threads for some samples for CFL conditions. Search the forum for more samples.
CFL with conditions
cfl conditions
RE: CFL Conditions
CFL Conditions and Edit Text
Vasu Natari. -
Hi all,
I have made one form for operation master.
I try to use this UDO as a CFL in another form call router.
I am trying to add CFL on the Matrix field in the Router form.
CFL is added perfectly. But when I try to press the tab on the Field. I got the following error.
Internal Error(-1003) occured Message [131-183]
I have checked the User define table and UDO length is less than eight character.
Kindly give me the solutions for the same.
Regards,
Gunjan Shukla.Hi,
There are a couple of reason why you're getting that error, but the most probable is that the CFL conditions are not correctly defined OR the ChooseFromListAlias is pointing to a field that does not exist. (example: You have ChooseFromListAlias = "U_Code" when it should be ChooseFromListAlias = "Code", or vice-versa).
Regards,
Vítor Vieira -
Blocking available for Customers & Vendors
What are the different levels of blocking available for Customers & Vendors
thanks regards
manojHi,
blocking means what? is it regarding cfl condition or not?
Please explain in detail what exactly u want.
Regards,
Mahendra -
Run time filter on choose list
Hi Experts
I have two editboxes on a form . Both have choose list. I want to filter the second editbox choose list by the value of first editbox. So I set a condition on second editbox in "BeforeChooselistEvent" It works for the first time but on second time It does not show data. Anyone can guide me which Event I use and how can I handle "Run Time Filter on a choose List". My code of Before Choose List is given Below
<B1Listener(BoEventTypes.et_CHOOSE_FROM_LIST, True, New String() {"2000021000"})> _
Public Overridable Function OnBeforeChooseFromList(ByVal pVal As ItemEvent) As Boolean
Dim form As Form = B1Connections.theAppl.Forms.Item(pVal.FormUID)
'ADD YOUR ACTION CODE HERE ...
Dim editBincode As EditText
Dim editWhseFrom As EditText
Dim editWhseTo As EditText
Dim oItem As Item
If pVal.ItemUID = "E003" And pVal.FormType = "2000021000" Then
oItem = form.Items.Item("E001")
editWhseFrom = oItem.Specific
oItem = form.Items.Item("E002")
editWhseTo = oItem.Specific
Dim iChoose As SAPbouiCOM.IChooseFromListEvent
Dim oCons As SAPbouiCOM.Conditions
Dim oCon As SAPbouiCOM.Condition
Dim val As String
Dim val1 As String
iChoose = pVal
Dim CFL_ID As String
CFL_ID = iChoose.ChooseFromListUID
Dim oForm As SAPbouiCOM.Form
oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID)
Dim CFL As SAPbouiCOM.ChooseFromList
CFL = form.ChooseFromLists.Item(CFL_ID)
oCons = CFL.GetConditions()
oCon = oCons.Add()
oCon.Alias = "U_Whse"
oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL
oCon.CondVal = editWhseFrom.Value
CFL.SetConditions(oCons)
'MsgBox(editWhseFrom.Value)
End If
Return True
End FunctionHello,
Yes, becasue in the second time you also adding the conditions value to it, but if you select the 2dn time the same value it is working.
When you defined the condiftion for your form (not in the eventhandler) add an extra code to the CFL conditions
oCons = CFL.GetConditions()
oCon = oCons.Add()
oCon.Alias = "U_Whse"
oCon.Operation = SAPbouiCOM.BoConditionOperation.co_CONTAIN
oCon.CondVal = '*'
CFL.SetConditions(oCons)
This means the following sql where condition
where U_Whse like '%%'
which select everything
Next step, the eventhandler you should use the first element of the conditions object
In your code
Dim CFL As SAPbouiCOM.ChooseFromList
CFL = form.ChooseFromLists.Item(CFL_ID)
oCons = CFL.GetConditions()
oCon = oCons.Item(0)
oCon.Alias = "U_Whse"
oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL
oCon.CondVal = editWhseFrom.Value
CFL.SetConditions(oCons)
Regards,
J.
Edited by: János Nagy on Jan 20, 2010 10:31 AM -
Customize ChooseFromList in System Form
It is possible to customize the ChooseFromList of TaxCode (A/P Invoice) i.e only TaxCode of type CST should be displayed and not the VAT.
hi,
yes u can customise by using CFL Conditions on Form Load event.
Private Sub AddChooseFromList()
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)
oCFLCreationParams.MultiSelection = False
oCFLCreationParams.ObjectType = "128"
oCFLCreationParams.UniqueID = "CFL_Cons"
oCFL = oCFLs.Add(oCFLCreationParams)
' Adding Conditions
oCons = oCFL.GetConditions()
oCon = oCons.Add()
oCon.Alias = "Code"
oCon.Operation = SAPbouiCOM.BoConditionOperation.co_START
oCon.CondVal = "CST" 'this shows the value which starts with CST
oCFL.SetConditions(oCons)
Dim oMatrix As SAPbouiCOM.Matrix = SBO_Application.Forms.Item("FormUID").Items.Item("MatrixUID").Specific
oMatrix.Columns.Item("TaxColUID").ChooseFromListUID = "CFL_Cons"
oMatrix.Columns.Item("TaxColUID").ChooseFromListAlias = "Code"
Catch
MsgBox(Err.Description)
End Try
End Sub
hope this is your result.
regards,
varma -
How to set conditions as a query in cfl?
i have a combo box and a matrix. i have a cfl in the matrix column, once i select the particular value in the combobox the corresponding values must appear in the cfl. how can this be done?
Hi Metilda,
You can try this, i'use this code to set conditions in a CFL for item list. I put this code in the et_CHOOSE_FROM_LIST event in beforeaction=True :
SAPbouiCOM.EditText oEdit;
oEdit = (SAPbouiCOM.EditText)oForm.Items.Item("7").Specific;
string typeMag = oEdit.Value.ToString().Trim();
oCons = oCFL.GetConditions();
if (oCons.Count == 0)
if (typeMag.Substring(0, 1) == "C")
oCon = oCons.Add();
oCon.BracketOpenNum = 2;
oCon.Alias = "SellItem";
oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL;
oCon.CondVal = "Y";
oCon.BracketCloseNum = 1;
oCon.Relationship = SAPbouiCOM.BoConditionRelationship.cr_AND;
oCon = oCons.Add();
oCon.BracketOpenNum = 1;
oCon.Alias = "U_IFC_CAT";
oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL;
oCon.CondVal = typeMag;
oCon.BracketCloseNum = 2;
oCFL.SetConditions(oCons);
else
oCon = oCons.Add();
oCon.BracketOpenNum = 2;
oCon.Alias = "SellItem";
oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL;
oCon.CondVal = "Y";
oCon.BracketCloseNum = 1;
oCon.Relationship = SAPbouiCOM.BoConditionRelationship.cr_AND;
oCon = oCons.Add();
oCon.BracketOpenNum = 2;
oCon.Alias = "U_IFC_CAT";
oCon.Operation = SAPbouiCOM.BoConditionOperation.co_IS_NULL;
//oCon.CondVal = null;
oCon.BracketCloseNum = 1;
oCon.Relationship = SAPbouiCOM.BoConditionRelationship.cr_OR;
oCon = oCons.Add();
oCon.BracketOpenNum = 1;
oCon.Alias = "U_IFC_CAT";
oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL;
oCon.CondVal = "";
oCon.BracketCloseNum = 3;
oCFL.SetConditions(oCons);
else
oCons = null;
oCFL.SetConditions(oCons);
oCons = oCFL.GetConditions();
if (typeMag.Substring(0, 1) == "C")
oCon = oCons.Add();
oCon.BracketOpenNum = 2;
oCon.Alias = "SellItem";
oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL;
oCon.CondVal = "Y";
oCon.BracketCloseNum = 1;
oCon.Relationship = SAPbouiCOM.BoConditionRelationship.cr_AND;
oCon = oCons.Add();
oCon.BracketOpenNum = 1;
oCon.Alias = "U_IFC_CAT";
oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL;
oCon.CondVal = typeMag;
oCon.BracketCloseNum = 2;
oCFL.SetConditions(oCons);
else
oCon = oCons.Add();
oCon.BracketOpenNum = 2;
oCon.Alias = "SellItem";
oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL;
oCon.CondVal = "Y";
oCon.BracketCloseNum = 1;
oCon.Relationship = SAPbouiCOM.BoConditionRelationship.cr_AND;
oCon = oCons.Add();
oCon.BracketOpenNum = 2;
oCon.Alias = "U_IFC_CAT";
oCon.Operation = SAPbouiCOM.BoConditionOperation.co_IS_NULL;
//oCon.CondVal = null;
oCon.BracketCloseNum = 1;
oCon.Relationship = SAPbouiCOM.BoConditionRelationship.cr_OR;
oCon = oCons.Add();
oCon.BracketOpenNum = 1;
oCon.Alias = "U_IFC_CAT";
oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL;
oCon.CondVal = "";
oCon.BracketCloseNum = 3;
oCFL.SetConditions(oCons);
It's work fine for me. -
How to set condition in CFL which are alredy assign in EditText
Hi
All
I create a Screen Printer Form where i assign a edit text to ChooseFromList as follow-
1)1st create a CFL using Collection Tab in screen printer and set the Object type=2 and Unique Id=CFL_2
2)Then assign CFL_2 to EditText in Item Tab window.
In that case CFL show All the Business partners. so my question is how i set the Condition in CFL_2 according to CardType.
thanks
SubhasHi,
Give a new Unique Id and assign that to edittext
Dim oCons As SAPbouiCOM.Conditions
Dim oCon As SAPbouiCOM.Condition
oCons = New SAPbouiCOM.Conditions
oCon = oCons.Add()
oCon.Alias = "U_CLEARED"
'oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL
oCon.CondVal = val
Dim oCFL As SAPbouiCOM.ChooseFromList
Dim oEdit As SAPbouiCOM.EditText
Dim oCFLs As SAPbouiCOM.ChooseFromListCollection
oCFLs = oForm.ChooseFromLists
oitem = oForm.Items.Item(ItemUID)
oEdit = oitem.Specific
Dim oCFLCreationParams As SAPbouiCOM.ChooseFromListCreationParams
oCFLCreationParams = SBO_Application.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_ChooseFromListCreationParams)
oCFLCreationParams.MultiSelection = False
oCFLCreationParams.ObjectType = "AUCTIONS"
Try
oCFLCreationParams.UniqueID = "CFL1_ACV" & val
Catch ex As Exception
End Try
Try
oCFL = oCFLs.Add(oCFLCreationParams)
Catch ex As Exception
End Try
Try
oCFL.SetConditions(oCons)
Catch ex As Exception
End Try
oEdit.ChooseFromListUID = "CFL1_ACV" & val
oEdit.ChooseFromListAlias = "Code" -
How to set a Multiple condition in a single CFL
Hi everyone,
Hey guys, i have a problem filtering a CFL (ChooseFromList)
where i have to select records
WHERE U_SalesmanCode = <ConVal>
AND U_Status = <ConVal>
So i've come up with an idea setting up multiple conditions on a single CFL.
i have a function "SetCFLConditions" that will be called after the CHOOSEFROMLIST_EVENT was triggered. this will set the conditions on a loop method.
the CODE works fine. but it only accepts the last condition.
Public Sub SetCFLConditions(ByVal _chooseFromList As String, _
ByVal _alias As String, _
ByVal _operation As SAPbouiCOM.BoConditionOperation, _
ByVal _condVal As String)
Dim oCFLCollection As SAPbouiCOM.ChooseFromListCollection = _form.ChooseFromLists
Dim oCFL As SAPbouiCOM.ChooseFromList = oCFLCollection.Item(_chooseFromList)
Dim oCons As SAPbouiCOM.Conditions
Dim oCon As SAPbouiCOM.Condition
Dim asAlias() As String = _alias.ToString.Split(",")
Dim asCondVal() As String = _condVal.ToString.Split(",")
Dim i As Int16
oCFL.SetConditions(Nothing)
'oCons = oCFL.GetConditions()
For i = 0 To asAlias.Length - 1
oCons = oCFL.GetConditions()
oCon = oCons.Add
'//LOOP CONDITIONS
With oCon
.Alias = asAlias(i)
.Operation = _operation
.CondVal = asCondVal(i)
End With
Next i
oCFL.SetConditions(oCons)
End Sub
Pls. Help
Thanks
RogerHi,
This is how i add the conditions..
Dim oCFLS As SAPbouiCOM.ChooseFromListCollection
Dim oCons As SAPbouiCOM.Conditions
Dim oCon As SAPbouiCOM.Condition
Dim oCFL As SAPbouiCOM.ChooseFromList
Dim oCFLCreationParams As SAPbouiCOM.ChooseFromListCreationParams
oCFLS = objForm.ChooseFromLists
oCFLCreationParams = objSBOAPI.CreateUIObjectSAPbouiCOM.BoCreatableObjectType.cot_ChooseFromListCreationParams)
oCFLCreationParams.MultiSelection = False
oCFLCreationParams.ObjectType = "2"
oCFLCreationParams.UniqueID = "CFL1"
oCFL = oCFLS.Add(oCFLCreationParams)
oCFLCreationParams.ObjectType = "2"
oCFLCreationParams.UniqueID = "CFL2"
oCFL = oCFLS.Add(oCFLCreationParams)
oCons = objForm.ChooseFromLists.Item("CFL1").GetConditions
oCon = oCons.Add()
oCon.Alias = "CardType"
oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL
oCon.CondVal = "C"
objForm.ChooseFromLists.Item("CFL1").SetConditions(oCons)
objForm.ChooseFromLists.Item("CFL2").SetConditions(oCons)
Hope it helps,
Vasu Natari. -
How to set a Multiple condition for a single CFL
Hi everyone,
Hey guys, i have a problem filtering a CFL (ChooseFromList)
where i have to select records
WHERE U_SalesmanCode = <ConVal>
AND U_Status = <ConVal>
so i've some up with an idea setting up multiple conditions on a single CFL.
i have a function "SetCFLConditions" that will be called after the CHOOSEFROMLIST_EVENT was triggered. this will set the conditions on a loop method.
the CODE works fine. but it only accepts the last condition.
Public Sub SetCFLConditions(ByVal _chooseFromList As String, _
ByVal _alias As String, _
ByVal _operation As SAPbouiCOM.BoConditionOperation, _
ByVal _condVal As String)
Dim oCFLCollection As SAPbouiCOM.ChooseFromListCollection = _form.ChooseFromLists
Dim oCFL As SAPbouiCOM.ChooseFromList = oCFLCollection.Item(_chooseFromList)
Dim oCons As SAPbouiCOM.Conditions
Dim oCon As SAPbouiCOM.Condition
Dim asAlias() As String = _alias.ToString.Split(",")
Dim asCondVal() As String = _condVal.ToString.Split(",")
Dim i As Int16
oCFL.SetConditions(Nothing)
'oCons = oCFL.GetConditions()
For i = 0 To asAlias.Length - 1
oCons = oCFL.GetConditions()
oCon = oCons.Add
'//LOOP CONDITIONS
With oCon
.Alias = asAlias(i)
.Operation = _operation
.CondVal = asCondVal(i)
End With
Next i
oCFL.SetConditions(oCons)
End Sub
Pls. Help
Thanks
Edited by: Roger Arce on Apr 17, 2009 12:14 PM
Edited by: Roger Arce on Apr 17, 2009 12:15 PMHai Roger Arce
Better you post your question in SDK forum
Edited by: Prasanna s on Apr 17, 2009 12:52 PM -
Set Conditions to CFL in Copy From
I didn't find any ways to set conditions on this CFL, that shows when f.i. in AR Invoices deliveries is chosen as basedocument. What i found are only modifications to the BP CFL in Marketing Documents. That's not what i need. I simply need hints or code provided for my solution. Thanks in advance.
I found the correct ItemUID via a MsgBox showing it when the event is cought.
I can set the conditions without problems. The problem now is that setting the condition has no effect on the CFL i want to filter.
Here is my code:
If pVal.FormTypeEx = 133 Then
oOrderForm = SBO_Application.Forms.GetFormByTypeAndCount(pVal.FormType, pVal.FormTypeCount)
If pVal.EventType = SAPbouiCOM.BoEventTypes.et_CHOOSE_FROM_LIST And pVal.BeforeAction = True Then
If pVal.ItemUID = "35" Then
BubbleEvent = False
Try
Dim oCons As SAPbouiCOM.Conditions
Dim oCFL As SAPbouiCOM.ChooseFromList
Dim oCon As SAPbouiCOM.Condition
oCFL = oOrderForm.ChooseFromLists.Item("15")
oCons = oCFL.GetConditions
If 0 = oCons.Count Then
oCon = oCons.Add()
oCon.Alias = "U_WP_STAT"
oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL
oCon.CondVal = "J"
oCFL.SetConditions(oCons)
End If
BubbleEvent = True
Catch ex As Exception
SBO_Application.StatusBar.SetText(ex.Message, SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error)
End Try
End If
End If
End If -
Dear friends,
I am trying to filter the CFL. But it does not show any data when use this snippet.
If OCT_Company.Connected Then
Dim oCon As SAPbouiCOM.Condition = Nothing
Dim oRs As SAPbobsCOM.Recordset = OCT_Company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
oRs.DoQuery("SELECT DISTINCT CODE FROM [@FPSM]")
For i As Integer = 0 To oRs.RecordCount - 1
oCon = oCons.Add()
oCon.BracketOpenNum = 1
oCon.Alias = "Code"
oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL
oCon.CondVal = oRs.Fields.Item("Code").Value
oCon.BracketCloseNum = 1
oRs.MoveNext()
If i >= 1 And i <= oRs.RecordCount - 1 Then
oCon.Relationship = SAPbouiCOM.BoConditionRelationship.cr_OR
End If
Next
chlFICI.SetConditions(oCons)
Else
OCT_Application.StatusBar.SetText("You are not connected to company", SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error)
End If
Can anybody point out the bug.....
HOW TO USE CONTAINS OPERATOR INSTEAD OF EQUAL IN OPERATION PROPERTYHi Manish
Try this
If OCT_Company.Connected Then
Dim oCon As SAPbouiCOM.Condition = Nothing
Dim oRs As SAPbobsCOM.Recordset = OCT_Company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
oRs.DoQuery("SELECT DISTINCT CODE FROM @FPSM")
i = 0
While Not oRS.EoF
If i > 0 Then
oCondition.Relationship = SAPbouiCOM.BoConditionRelationship.cr_OR
End If
oCon = oCons.Add()
oCon.Alias = "Code"
oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL
oCon.CondVal = oRs.Fields.Item(0).Value
oRs.MoveNext()
i+=1
End While
chlFICI.SetConditions(oCons)
Else
OCT_Application.StatusBar.SetText("You are not connected to company", SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error)
End If
Also check these threads
Error: Matrix CFL With Query Condition
Filter list of customers in document form
Regards
Arun -
Multiple Condition in Single CFL
Dear All,
In my code CFL only recognizes the last condition.So how to set the loop for this condition
If vendorcode = "" Then
SBO_Application.StatusBar.SetText("Please select vendorcode", SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error)
BubbleEvent = False
Exit Sub
Else
Dim i As Integer
i = 0
Dim oCFLs As SAPbouiCOM.ChooseFromListCollection = oForm.ChooseFromLists
oCFL = oCFLs.Item("CFL_6")
oCFL.SetConditions(Nothing)
oCons = oForm.ChooseFromLists.Item("CFL_6").GetConditions
oCon = oCons.Add()
oCon.Alias = "CardCode"
oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL
oCon.CondVal = vendorcode
oCon = oCons.Add()
oCon.Alias = "U_DCSta"
oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL
oCon.CondVal = i
'oCon = oCons.Add()
oForm.ChooseFromLists.Item("CFL_6").SetConditions(oCons)
End If
Regards,
GuruGuru,
Please refer to the following sample code for multiple condition.
'// create a new conditions collection
Set oConditions = SBO_Application.CreateObject(cot_Conditions)
'// Let's assume we wish our query to select
'// Bussines Partners of type "C" (Customers)
'// or "S" (Suppliers)
'// WHERE ((CardType = 'C') Or (CardType = 'S'))
'// the conditions collection encapsulates the WHERE clause
'// of a select statement
Set oCondition = oConditions.Add
'// ((CardType = 'C') Or
oCondition.BracketOpenNum = 2
oCondition.Alias = "CardType"
oCondition.Operation = co_EQUAL
oCondition.CondVal = "C"
oCondition.BracketCloseNum = 1
oCondition.Relationship = cr_OR
Set oCondition = oConditions.Add
'// (CardType = 'S'))
oCondition.BracketOpenNum = 1
oCondition.Alias = "CardType"
oCondition.Operation = co_EQUAL
oCondition.CondVal = "S"
oCondition.BracketCloseNum = 2
Regards, yatsea
Maybe you are looking for
-
Problem using PAPI-WS for external process notifcation
Hello, I'm trying to have an external Java application send a process notification using PAPI-WS. I have a process instance currently sitting at a notifcation wait step (configured to wait for an external notification) but each time I call processSen
-
Can apple fix my iphone 4s after it fell into water for a few seconds?
Can Apply fix my phone that has fallen into water for a few seconds?
-
Variable cumulativeWrite might not have been initialized
This one has stumped me. Ive already looked on Google before anyone says, i didnt find an understandable answer. public static void writeFile(){ int writeInt; String writeStr; String cumulativeWrite; try {
-
Maximum number of database instance on Exadata V2
Does any body know maximum of database instance can starting on Exadata V2, haft rack configuration. I can start only 13 instance but when start instance 14 it failed. I had try to increased number of semaphore but still not work.
-
Using find my iphone when I only own that device. Where to access?
How can husband use Find My Phone. Only has iphone. I have the other devices? Two different apple id's? Can he still, find his phone?