How to filter Choose from list object rows?

Hi everyone,
I'd like to show Choose from list window using SBO 2005 PL07, Actually I want to show the Active Account of G/L Account, I set the CFL object to one column as following:
oCFLCreationParams.ObjectType = SAPbouiCOM.BoLinkedObject.lf_GLAccounts
oCFLCreationParams.UniqueID = "CFL"
oCFL = oCFLs.Add(oCFLCreationParams)
Who knows how to set Choose From list object only show Active Account and do not show Title Account.
Thanks for your help!
Kathy

Hi kathy
I have not tried it on the gl accounts. But basicaly you need to add conditions to filter it. The following is an example that you would of used for business partners but only customers.
  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)
            ' Adding 2 CFL, one for the button and one for the edit text.
            oCFLCreationParams.MultiSelection = False
            oCFLCreationParams.ObjectType = "2"
            oCFLCreationParams.UniqueID = "CFL1"
            oCFL = oCFLs.Add(oCFLCreationParams)
            ' Adding Conditions to CFL1
            oCons = oCFL.GetConditions()
            oCon = oCons.Add()
            oCon.Alias = "CardType"
            oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL
            oCon.CondVal = "C"
            oCFL.SetConditions(oCons)
            oCFLCreationParams.UniqueID = "CFL2"
            oCFL = oCFLs.Add(oCFLCreationParams)
The above also compensates for the tab.
Hope it helps

Similar Messages

  • How i  create choose from list for profit center

    Hello ALL ,
    Can any body suggest me how we  create the CFL for profit Center  .
    I am creating  add -on using sdk and create a screen form using screen Painter .
    In my form there is  matrix that contain the profit center column  just like in sale order screen .
    In this field (Profit Center )  I want to attach the CFL of profit center just like in sales Order screen .
    but  I am unable to find out the object type ID for profit center so please give me any idea

    Hi,
    Please post is on the SDK forum and close this thread.  This is an SDK question.
    Thanks,
    Gordon

  • Can anyone explain how we create Choose from list for profit center in sap b1

    Hello ALL ,
    Can any body suggest me how we create the CFL for profit Center .
    I am creating add -on using sdk and create a screen form using screen Painter .
    In my form there is matrix that contain the profit center column just like in sale order screen .
    In this field (Profit Center ) I want to attach the CFL of profit center just like in sales Order screen .
    but I am unable to find out the object type ID for profit center so please give me any idea

    Hi Arvind,
    Object type for the Profit Center is
    <ChooseFromList UniqueID="CFL_1" ObjectType="61" MultiSelection="0" IsSystem="0"/>
    and for the Distribution Rule
    <ChooseFromList UniqueID="CFL_2" ObjectType="62" MultiSelection="0" IsSystem="0"/>
    Hope it helps.
    D.

  • Add Choose From List to a Matrix

    Hi,
    Need help on how to add a choose from list to a matrix column?
    Thanks!

    Hi,
    Step1 :First step is to create the CFL as below
    Private Sub AddChooseFromListToWorkOrder()
            'Choose From List Collection object to store the collection
            Dim oCFLs As SAPbouiCOM.ChooseFromListCollection
            'Conditions object to set the conditons
            Dim oCons As SAPbouiCOM.Conditions
            'Condition object to set the conditons
            Dim oCon As SAPbouiCOM.Condition
            'Getting the Form Choose From Lists
            oCFLs = oForm.ChooseFromLists
            'Choose From List object to store the ChooseFromList
            Dim oCFL As SAPbouiCOM.ChooseFromList
            'ChooseFromListCreationParams to create the parameters for the CFL
            Dim oCFLCreationParams As SAPbouiCOM.ChooseFromListCreationParams
            oCFLCreationParams = oSBOApplication.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_ChooseFromListCreationParams)
            oCFLCreationParams.MultiSelection = False
            oCFLCreationParams.ObjectType = "4"
            oCFLCreationParams.UniqueID = "UDCFL1"
            oCFL = oCFLs.Add(oCFLCreationParams)
            ' Adding Conditions to CFL
            oCons = oCFL.GetConditions()
            oCon = oCons.Add()
            oCon.Alias = "U_HasPSC"
            oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL
            oCon.CondVal = "Y"
            oCFL.SetConditions(oCons)
        End Sub
    Step2: Then add this cfl in form load
    AddChooseFromListToWorkOrder()
    oMatrix = oForm.Items.Item("matItems").Specific
    oColumns = oMatrix.Columns
    oColumn = oColumns.Item("colItem")
    oColumn.ChooseFromListUID = "UDCFL1"
    oColumn.ChooseFromListAlias = "ItemCode"
    Step 3: catch the CFL Event in Item events of the form
    If pVal.EventType = SAPbouiCOM.BoEventTypes.et_CHOOSE_FROM_LIST Then
                            oForm = oSBOApplication.Forms.Item("IS_WKORDER")
                            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 = oCFLEvento.SelectedObjects
                                'oForm.DataSources.DBDataSources.Add("@IS_WKO_ROWS")
                                Try
                                    If pVal.ItemUID = "matItems" And pVal.ColUID = "colItem" And oCFL.UniqueID = "UDCFL1" Then
                                        oMatrix = oForm.Items.Item("matItems").Specific
                                        oEdit = oMatrix.Columns.Item(2).Cells.Item(pVal.Row).Specific
                                        oEdit.Value = oDataTable.GetValue(1, 0).ToString()
                                        oEdit = oMatrix.Columns.Item(4).Cells.Item(pVal.Row).Specific
                                        oEdit.Value = strUOM
                                        oEdit = oMatrix.Columns.Item(5).Cells.Item(pVal.Row).Specific
                                        oEdit.Value = strPSCode
                                        oEdit = oMatrix.Columns.Item(1).Cells.Item(pVal.Row).Specific
                                        oEdit.Value = oDataTable.GetValue(0, 0).ToString()
                                    End If
                                Catch ex As Exception
                                End Try
                            End If
                        End If
    Hope This helps
    Regards,
    Noor
    Edited by: noor_023 on Mar 31, 2010 10:55 AM

  • UDO-Choose From List

    Hi;
    I would appreciate if someone could tell me how to associate an UDO to a choose from list.
    I have looked over the SDK example, but this is for standar SAP objects and I need to associate the choose from list to a customer object. 
    Best regards

    The choose from list (CFL) can be triggered from your edittext - there is some sample code in the DI API help file that shows this.  Have a look for 'Adding a choose from list object' in the help file.  Remember that where they set ObjectType="2", you should use the name of your UDO.
    As can also be seen in the help file, CFL objects allow you to add conditions to determine what rows are displayed.  In the example it shows selecting only where CardType = 'C'.  The columns displayed can be tailored by the user at runtime, where they can select from any columns that are on your main UDO table.
    There are a few limitations.  At present CFL's do not allow you to directly specify a SQL query.  Only data from the single table related to the 'ObjectType' is displayed.  If you want a more complex query that displays data from multiple tables when you press tab, a formatted search may be more powerful.  If you search the forums you should find one of my previous posts (probably about a year ago) where I showed how to link a formatted search to the tab keypress and have it behave in a very similar manner to a CFL.
    John.

  • How to filter results from 4 dynamic list menus depandant on how many of them are selected

    I have a search page with a form with 4 list menus and 1 submit that post the results to the results page. I can create a record set that either retrieves the correct data from my database if a selection is made from all four menus Or i can create the recordset if only 3 menus have a selection or the same for 2 menus and 1 menu. However i want the user to be able to make a selection from either 1, 2, 3 or all 4 of the menus and the exact data be retrieved. At present if i try to combine the recordset using AND and ORs the results are not specific enough, for example the 4 menus are Location, Type, Price & Style if a user selects from all 4 i only want to retrieve data that matches all 4 criteria, but at the same time if the user selects only 2 of the menus the i want it to retrieve data that matches specifically those 2 variables. I´m not actually sure if i should be creating a more advanced sql query of if its the php side of things that i need to look at. This is my first dynamic site so please be aware i´m still a learner where php and sql is concerned. Please can anyone help?  

    Hey there,
    Thanks for replying,
    I too am using Dreamweaver recordset, my local server is XAMPP ( apache php mysql), i´have pasted my sql recordset below to give an idea of what i´m trying to do, however this does not work as i´m trying to select the exact data based on 4 menus PRICE TYPE LOCATION and BEDS, and also want the search to work if the user only selects options from either 1, 2, 3 or 4 of the menus, with the code as it is if the user select only two options from 2 of the menus the results don´t just find (for example) all results for location AND price they find all results for the location varibale OR the price variable rather than a match for both, if you see what i mean?
    Any suggestions?  
    SELECT trueprice,`desc`, `propid`, `bathrooms`, `photo1`, locationtable.loc, typetable.style, bedtable.`number`
    FROM detailstable JOIN locationtable ON detailstable.location=locationtable.locid JOIN typetable ON detailstable.type=typetable.typeid JOIN pricetable ON detailstable.price=pricetable.priceid JOIN bedtable ON detailstable.beds=bedtable.bedid
    WHERE (location=varloc AND price = varprice AND type=vartype AND beds=varbed ) OR (price=varprice AND location=varloc AND type=vartype) OR  (price=varprice AND location=varloc AND beds=varbed) OR (price=varprice AND beds=varbed AND type=vartype) OR  ( location=varloc AND type=vartype AND beds=varbed) OR  (price=varprice AND location=varloc) OR (price=varprice AND type=vartype) OR (price=varprice AND beds=varbed) OR (type=vartype AND location=varloc) OR (type=vartype AND beds=beds) OR (location=varloc AND beds=varbed) OR (price = varprice OR beds=varbed OR type=vartype OR location=varloc)
    ORDER BY detailstable.trueprice ASC
    Look forward to receiving your thoughts,
    Linda
    Date: Wed, 21 Oct 2009 14:36:33 -0600
    From: [email protected]
    To: [email protected]
    Subject: how to filter results from 4 dynamic list menus depandant on how many of them are selected
    Hiya,
    I'm just doing my first dynamic site too, and am at a similar level to yourself.
    Can you give us more info re the site. What software, eg Dreamweaver etc are you using, and is your server using PHP or ASP etc?
    For what I've used, I amended the SQL side of things in the recordset in Dreamweaver. That way, you can test the SQL as you're setting up the recordset.
    Let me know how you're going on anyway
    Cheers
    Andy
    >

  • 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
    Vivek

    Hi.
    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

  • Choose From list in Matrix UDF

    i create a UDF in Sales Order Row, I want to assign choose From list in the Matrix for the UDF once user click on tab button.
    How can i assign the Choose from list for the UDF column?

    Hi,
    Try this code for adding CFL.             
                   SAPbouiCOM.ChooseFromListCollection oCFLs = null;
                    SAPbouiCOM.Conditions oCons = null;
                    SAPbouiCOM.Condition oCon = null;
                    oCFLs = oForm.ChooseFromLists;
                    SAPbouiCOM.ChooseFromList oCFL = null;
                    SAPbouiCOM.ChooseFromListCreationParams oCFLCreationParams = null;
                    oCFLCreationParams = ( ( SAPbouiCOM.ChooseFromListCreationParams )( SBO_Application.CreateObject( SAPbouiCOM.BoCreatableObjectType.cot_ChooseFromListCreationParams ) ) );
                    oCFLCreationParams.MultiSelection = false;
                    oCFLCreationParams.ObjectType = "object id ";
                    oCFLCreationParams.UniqueID = "CFL1";
                    oCFL = oCFLs.Add( oCFLCreationParams );
                   oColumn.ChooseFromListUID = "CFL1";
                  //where oColumn is the instance of that column.
    Hope u will get help....
    Thanks and Regards,
    Lalit

  • Addon in choose from list

    Dear All Technical Experts,
    I would like to add new field in choose from list window that is run from production order --> issue for production --> click production order button.
    I could not find out how to add new information or filter field there. is it possible for me using addon ? The information I need available is remarks (OWOR.remarks). If yes, will it be UI addon or UI/DI ?
    I appreciate your answer. TIA
    Rgds,

    Hi,
    First create the srf which has two buttons- Choose and Cancel
    code for creating the grid :- you have to pass the SQL query as a paramter in the below function .In query you choose as many as fields from the table ,at run time columns will  automatically created corresponds to your query.
         private bool CreateGrid(string sSQL)
                        try
                        SAPbouiCOM.Item oItem;
                        oItem = oform.Items.Add("Grid", SAPbouiCOM.BoFormItemTypes.it_GRID);
                        oItem.Left = 7;
                        oItem.Width = 387;
                        oItem.Top = 47;
                        oItem.Height = 188;
                        oform.DataSources.DataTables.Add("dtLookUpTable");
                        oDataTable = oform.DataSources.DataTables.Item("dtLookUpTable");
                        oDataTable.Clear();
                        oDataTable.ExecuteQuery(sSQL);
                        oGrid = (SAPbouiCOM.Grid)oItem.Specific;
                    oGrid.SelectionMode = SAPbouiCOM.BoMatrixSelect.ms_Single ;
                        oGrid.DataTable = oDataTable;
                                            if(oGrid.Rows.Count > 0)
                             oGrid.Rows.SelectedRows.Add(0);
                    for (int iColCounter = 0; iColCounter < oGrid.Columns.Count; iColCounter++)
                        oGrid.Columns.Item(iColCounter).Width = 50;
                        oGrid.Columns.Item(iColCounter).Editable = false;
                        oGrid.AutoResizeColumns();
                        return true;
                   catch(Exception ex)
                        oform.Freeze(false);
                        throw ex;
    choose the value on pressing the button 'Choose'
         protected override void ITEMPRESS_AFTERACTION(ref SAPbouiCOM.ItemEvent pVal, out bool BubbleEvent, SAPbouiCOM.Application oSboApplication, SAPbobsCOM.Company oCompany)
                   BubbleEvent = true;
                    if (pVal.ItemUID == "choosebuttonuid")
                        if (oGrid.Rows.SelectedRows.Count > 0)
                            SAPbouiCOM.DataTable oReturnTable = null;
                            oform.DataSources.DataTables.Add("dtReturnTable");
                            oReturnTable = oform.DataSources.DataTables.Item("dtReturnTable");
                            oReturnTable.CopyFrom(oDataTable);
                            for (int iRowIndex = 0; iRowIndex < oReturnTable.Rows.Count; iRowIndex++)
                                oReturnTable.Rows.Remove(iRowIndex);
                            int iRow = oGrid.GetDataTableRowIndex(oGrid.Rows.SelectedRows.Item(0, SAPbouiCOM.BoOrderType.ot_RowOrder));
                            oReturnTable.Rows.Add(1);
                            //for (int iColIndex = 0; iColIndex < oReturnTable.Columns.Count; iColIndex++)
                            //    oReturnTable.SetValue(iColIndex, 0, oDataTable.GetValue(iColIndex, iRow));
                            oReturnTable.SetValue(0, 0, oDataTable.GetValue(0, iRow ));
                            oReturnTable.SetValue(1, 0, oDataTable.GetValue(1, iRow));
                            SBOAppAddOn.mLookupForms.Remove(oform.UniqueID.ToString());
    then u have to send the oReturnTable with parentuid( issue for production) to the baseform.
                       example->     SendData(oReturnTable, strParentFormUID, oSboApplication, oCompany);
                            oform.Close();
    More:-
    You have to include the Doubleclick faclity on the grid
    You have to include  the find functionality  also.

  • Receipt From production number - Choose From List

    Hi all,
    How to filter the Receipt from production number only comes in choose from list.  now i used object is 59. when i choose all value comes that means goods receipt, and receipt from production document numbers comes. I want only list out the Receipt from production Numbers only how to i restrict this.
    Thanks & regards
    B.Sudhir

    Hello
    It is very hard to do the CFL, because the information, that is it a receipt from a production is stored on the line level, not on the head level
    you can 2 choices
    1. define a query which includes all the DocEntry related to the Receipt documents, and on form constuction you add them into the conditions of the CFL (it takes much time to build up the CFL)
    2. Define FMS, and assign to your field. And when the user press the TAB key, you call the FMS.
    Regards
    János
    We always done the 2nd method until the cfl was not implemented.

  • Choose from list - data display with condition

    Hi,
    I 've developed a form using screen painter, I ' ve attached a choose from list to fill GRPo Number.  In the choose from list the GRPo no. should not display again which once I have selected and saved. 
    Let me have a good solution please and it would be appreciated.
    Thanks & Regards,
    Venkatesan G.

    Hi suresh,
    where did you put this code?....In the choose_from_list event handler?..I've tried a similar solution, before reading your post, but it doesn't work because if i dynamically set the condition for the choose from list i got an empty table.
    i've tried to put my code when beforeaction=true and i have this kind of problem. The difference is that i need to set the filter starting with the value i've entered on the field connected to the choose from list. I put code here, so it's more clear
    If (pVal.Before_Action = True) And (pVal.EventType = SAPbouiCOM.BoEventTypes.et_CHOOSE_FROM_LIST) Then
                        Dim oCFL As SAPbouiCOM.ChooseFromList
                        Dim oCons As SAPbouiCOM.Conditions
                        Dim oCon As SAPbouiCOM.Condition
                        Dim sItemCode As String
                        oEditText = oMatrix.Columns.Item("V_ItemCode").Cells.Item(pVal.Row).Specific
                        sItemCode = oEditText.Value.ToString
                        oCFL = oForm.ChooseFromLists.Item("CFL_Item")
                        oCons = oCFL.GetConditions()
                        oCon = oCons.Add()
                        oCon.Alias = "ItemCode"
                        oCon.Operation = SAPbouiCOM.BoConditionOperation.co_START
                        oCon.CondVal = sItemCode
                        oCFL.SetConditions(oCons)
                    End If
    My situation is that i type something in V_ItemCode column and after that i press the tab key to open the choose from list.
    Would be ok if i get the SAP standard beahviour too, that doesn't open the choose from list, but fills the field with the first code starting with what you type.
    Thanks in advance

  • Choose From List Condition

    Dear Experts,
    i want to select Items in Sales Quotation Screen  which is from Particular Group, I'm using following code
    If pVal.EventType = SAPbouiCOM.BoEventTypes.et_CHOOSE_FROM_LIST And pVal.BeforeAction = True Then
                If pVal.FormTye = "149" And pVal.ItemUID = "38" And (pVal.ColUID = "1" Or pVal.ColUID = "3") Then
                    Try
                        oForm = SBO_Application.Forms.ActiveForm
                        Dim oCFLEvento As SAPbouiCOM.IChooseFromListEvent = pVal
                        Dim sCFL_ID As String = oCFLEvento.ChooseFromListUID
                        Dim oCFL As SAPbouiCOM.ChooseFromList = Nothing
                        oCFL = oForm.ChooseFromLists.Item(sCFL_ID)
                        oCons = Nothing
                        oCon = Nothing
                        oCons = oCFL.GetConditions()
                        oCon = oCons.Add()
                        oCon.Alias = "ItmsGrpCod"
                        oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL
                        oCon.CondVal = "100"
                        oCFL.SetConditions(oCons)
                    Catch ex As Exception
                        SBO_Application.MessageBox(ex.Message)
                    End Try
                End If
            End If
    First time  Its working fine. but i'm selecting the next time in next row or same row its not showing any item. it opens only empty Choose from list. what is the prblm
    Mathi

    The problem is that when this event is called again, the Conditions object still has the conditions from the last call :
    oConditions = oCFL.GetConditions();  // this has all the previous set conditions
    So the conditions set before are also taken into consideration. What you need to do is :
    oCFL.SetConditions(null);
    oConditions = oCFL.GetConditions();
    This way the Conditions object will be empty. There is no method to remove a Condition from a Conditions collection, so you have to make it null.

  • Choose from list in Matrix

    Hey All,
    Has anyone been able to get the choose from list in a matrix text field working in SBO 2005 patch level 6? We have tried the tech demo and it works for new rows but not for existing rows. Also we have written our own code to set the matrix text box on the choose from list event and we get a general failure exception even though the value still gets set properly.
    If anyone has this working please post so we can all know how to do this properly.

    Hi there,
    This "Choose from list" thing is new for me, there's a Choose from List example in the new techDemo but i don't understand the code.. too complicated for me.. Is there any simple code/sample for this?
    Well i manage to trigger the choose from list .. but don't know how to put the selected value to the cell..
    Bruce..

  • Choose From List From a UDT in SAP Business One 2005 A

    Hi All
    How to develop a Choose From List from a <b>User Defined Table</b> (not from System Tables) in SAP Business One 2005 A.
    I need the Choose From List should display the records stored in the UDT.
    Any Idea ?
    Thanks in Advance.
    Regards.
    Asutosh.

    Hi Asutosh,
    You can add a CFL to a User Defined Object, not a simple User Defined Table.
    In order to do it you only have to set the object type of the CFL to the code of your UDO.
    Here you have a simple:
    oCFLCPuo = SB1_App.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_ChooseFromListCreationParams)
    oCFLCPuo.ObjectType = "MY_UDO_CODE"
    oCFLCPuo.UniqueID = "UserObjectCFL"
    oCFLuo = oForm.ChooseFromLists.Add(oCFLCPuo)
    Hope it helps
    Trinidad.

  • Choose from List for UDT

    I have made a UDT
    and I want to create a choose From List  of that table
    I know how to create choose frm list  for system tables
    like making Business partner  choose from list
    but I'm not able to make choose frm list for UDT
    please someone answer my question

    HI Riya,
    You can link a CFL to a User Defined Object but not a plain User Defined Table. A full list of options can be found in the UI help under BoLinkedObject Enumeration.
    Thanks,
    Lisa
    SAP Business One Forums

Maybe you are looking for

  • How to change Error Message into warning message

    Dear Friends, I am getting an error The qty stored that was entered is adjusted Message no. XU 040 at the time of GRN. I am maintaining batch specific Unit of Measure. Please tell me how to change this error message in to a warning message. Thanks Pr

  • After 4.3, iTunes no longer opens when I plug my iPhone in to sync

    I downloaded the most recent update. Now, when I plug in my iPhone to sync/charge, only iPhoto opens and iTunes will not.  I have the box checked in iTunes to open iTunes when the phone is connected but it doesn't and I have to open it manually.  Bug

  • ADF Application

    Hi, I am building my first ADF application and have just come across a problem i have never encoutered in the tutorials. I have passed a contactid value from one page to another using getProcessScope() in my entity view. How do i then display all the

  • Problem in installing skype

    please help me i am having a problem installing skype on my desktop, i am using windows 7 ultimate,  Solved! Go to Solution.

  • Is iOS 8 available for ipad air?

    is iOS 8 available for ipad air ? is this valid how can I update my ipad thanks