Edit and text and choose from list

hello,
I am trying to create a form that resemle to the purchase order form.
In the purchase order form when we select the card code from the choose from list
the system fill all the fileds like the name docnum .. with relevant information.
i tried to do that by using the vent et_evaluate of the edit text bind with the Card code in my form.
The problem is that when i clik on the choose from list button the event is lanched  and then the value of the card code is "" so i can't crate my queries to get the infomation like suplier name and ..
does any body have an answer?
This my code:
switch (pVal.ItemUID)
                                            case "3":
                                                    _Form.Freeze(true);
                                                    try
                                                        string NumFournisseur =
                                                            ((EditText) _Form.Items.Item("3").Specific).Value;
                                                        ArrayList DFournisseur =
                                                            new DB.PurchaseRequest(_SboCompany).
                                                                GetDetailsFournisseur(NumFournisseur);
                                                        EditText Textvar;
                                                        // remplir nom fournisseur et nom contact
                                                        Textvar = (EditText) _Form.Items.Item("2").Specific;
                                                        Textvar.String = DFournisseur[0].ToString();
                                                        Textvar = (EditText) _Form.Items.Item("4").Specific;
                                                        Textvar.String = DFournisseur[1].ToString();
                                                        // remplir les dates comptable , de livraiosn et du document
                                                        Textvar = (EditText) _Form.Items.Item("17").Specific;
                                                        Textvar.String = DateTime.Today.ToString();
                                                        Textvar = (EditText) _Form.Items.Item("19").Specific;
                                                        Textvar.String = DateTime.Today.ToString();
                                                        Textvar = (EditText) _Form.Items.Item("21").Specific;
                                                        Textvar.String = DateTime.Today.ToString();
                                                        // remplir devise partenaire et numéro document
                                                        ((EditText) _Form.Items.Item("59").Specific).String =
                                                            new DB.PurchaseRequest(_SboCompany).GetCurrencyCode(
                                                                NumFournisseur);
                                                        _Form.Items.Item("59").Visible = true;
                                                        _Form.Items.Item("59").Enabled = false;
                                                        ((ComboBox) _Form.Items.Item("10").Specific).Select(
                                                            "primary",
                                                            BoSearchKey.
                                                                psk_Index);
                                                        ((EditText) _Form.Items.Item("11").Specific).String =
                                                            new DB.PurchaseRequest(_SboCompany).GetLastDocNum().
                                                                ToString();
                                                        ((EditText) _Form.Items.Item("12").Specific).String = "0";
                                                    catch (Exception e)
                                                        Console.WriteLine(e.Message);
                                                    _Form.Freeze(false);
                                                    break;
                                        break;
                                    catch (Exception ex)
                                        Console.Write(ex.Message);
                            break;

Hey Achref,
You can use the event and code like this:
string vendCode = string.Empty;
SAPbouiCOM.IChooseFromListEvent oCFLEvento = (SAPbouiCOM.IChooseFromListEvent) pVal;
string sCFL_ID = oCFLEvento.ChooseFromListUID;
SAPbouiCOM.ChooseFromList oCFL = oVendorSourcingForm.ChooseFromLists.Item(sCFL_ID);
SAPbouiCOM.DataTable oDataTable =  oCFLEvento.SelectedObjects;
if (oDataTable != null)
     //get selected value from datatable
     if (oDataTable.Rows.Count > 0)vendCode = oDataTable.GetValue(0, 0).ToString();
Also check out 17.ChooseFromList in the samples that you can download.
Hope that helps
Curtis

Similar Messages

  • 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.....
    Thanks

    Hi 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

  • Choose From List and Golden arrow link in System Matrix UDF column

    I'm wondering if there is a way through the SDK to create a 'Choose From List' and Golden arrow linked button in a System Matrix UDF column? 
    For example the Item Code in a sales order matrix does both.

    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

  • Showing choose from list indicator on text edit field

    Hello expert,
    I have an UDF with a choose from list linked to one text edit object.
    Actually, I don't see the fields selection list indicator inside the text edit object.
    I thought it should have the same behavior as the cardcode text edit in the sales order form.
    Someone can explain me what's the reason ?
    Thanks in advance.
    Best regards
    Andrea

    Hi,
    If You Mean  To Display CFL Icon in the edit text then
    Try This.....
    Go To SAP Then
    View -
    > Pickers Display -
    > List Selection
    View-->Indicator Displaly--
    >Choose From List Fields
    Thanks
    Shafi

  • I need to know how to edit a drawing - basically remove the arrows and text but at the same time match the background of the existing pic. then re add new text. how do i erase the arrows and text and arrows but match current background of pic. step by ste

    i need to know how to edit a drawing - basically remove the arrows and text but at the same time match the background of the existing pic. then re add new text. how do i erase the arrows and text and arrows but match current background of pic. step by step explanation please beginner

    Please post (a relevant section of) it right on this Forum.

  • HT4528 Is there a fix for the bug where my BRAND NEW iphone 5S is locking up when I enable the magnifying glass to edit a text and it locks up!?

    Is there a fix for the bug where my BRAND NEW iphone 5S is locking up when I enable the magnifying glass to edit a text and it locks up!?

    Try a reboot press & hold power button & menu until Apple Logo comes on then wait
    you will not lose any data.
    That may fix your problem.
    bsydd uk

  • Removing Duplicates from a choose from list

    Hi All,
    I have a choose from list of obj 73 )Catalog Numbers (Table OSCN)
    I also added conditions in the CFL that it only shows the Substitute for the CardType = 'S' (Supllier) Business Partners.
    But I want to remove all the duplicate Substitutes from the CFL so that only distinct Catalog Numbers shows in the CFL.
            //  Adding 2 CFL, one for the button and one for the edit text.
                    oCFLCreationParams.MultiSelection = false;
                    oCFLCreationParams.ObjectType = "73";
                    oCFLCreationParams.UniqueID = "CFL1";
                    oCFL = oCFLs.Add(oCFLCreationParams);
                    //Adding Conditions to CFL1
                    oCons = oCFL.GetConditions();
                    oCon = oCons.Add();
                    oCon.Alias = "Substitute";
                    SAPbobsCOM.Recordset oSuppliers = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset);
                    oSuppliers.DoQuery("Select Distinct t1.Substitute From OSCN t1 Join OCRD t2 on t1.CardCode = t2.CardCode Where t2.CardType = 'S' Group By t1.Substitute");
                    oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL;
                    while (!oSuppliers.EoF)
                        oCon.CondVal = oSuppliers.Fields.Item(0).Value.ToString();
                        oCon.Relationship = SAPbouiCOM.BoConditionRelationship.cr_OR;
                        oCon = oCons.Add();
                        oCon.Alias = "Substitute";
                        oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL;
                        oSuppliers.MoveNext();
                    oCFL.SetConditions(oCons);
    Please advise....
    Kind Regards,
    Brenden Draper

    Hi Brenden,
    what you are trying to archieve won't work. Simply because CFL is getting all row data from  OSCN and ItemCode or CardCode can differ for a specific substitute.
    For example.
    ItemCode,CardCode,Substitute
    ItemA,BP1,sub1
    ItemA,BP2,sub1
    Would be 2 resultlines both with sub1 as substitute.
    SQL equivalent :
    Select Distinct t0.* from oscn t0 inner join OCRD t1 on t0.CardCode = t1.CardCode where t1.CardType = 'S'
    My advise would be to open a simple form with a grid and datatable bound.
    Some lines of coding and you get all you need.
    regards,
    Maik

  • Associating a Custome ResultSet with a Choose From List

    Hi Experts,
    I have to Link the Chose from List with a UDO for accessing the records from the Parent Table /Child Table
    How to crack this problem?
    Also I have to associate the Results of a custom query in a choose from list so that when I press TAB over a Text Box I get a Choose From List which displays the Results and I could select one of those rows.
    Plz Hint me for this Problem

    Hello,
    When you create CFL, just set your UDO type with oCFLCreationParams.ObjectType = "My_UDO", the collumn to be displayed in CFL has been determined by Find Service in your UDO definition.
    As per custom query, actually you can set the condition to do so. Direct customed SQL is not supported in CFL. You may refer to the SDK sample for further info after you install SDK component:
    <<C:\Program Files\SAP\SAP Business One SDK\Samples\COM UI\VB.NET\17.ChooseFromList>>
    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)
                ' Adding 2 CFL, one for the button and one for the edit text.
                oCFLCreationParams.MultiSelection = False
                'Just Set your UDO type.
                oCFLCreationParams.ObjectType = "My_UDO"
                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)
            Catch
                MsgBox(Err.Description)
            End Try
        End Sub
    Kind Regards
    -Yatsea

  • 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

  • Removing a Choose From List

    Hi
    I have a matrix containing numerous columns, one of which is a combo type column and one which is an edit box column containing a choose from list linking to the Item Master.
    What I need to happen is if the user selects a particular option from the combo column then the edit box column cell associated with that row will no longer allow the user to use the choosefromlist function and will not validate the value entered with an item. So basically I need to temporarily remove the choosefromlist functionality from this particular cell.
    The way I though of doing this was simply using a SAPbouiCOM.EditBox in order to select the particular cell and then try to set the .ChooseFromListUID property to "", however this does not work.
    Is there any way that this can be done?
    Thanks a lot
    Steve
    Edited by: Steven Tryner on Jun 9, 2009 4:41 PM

    Yeah I tried implementing this method into my code however the problem I had was stopping the cell from being automatically being validated against an Item, as it does with a choosefromlist. So if the text entered into the cell is not an Item the user can't navigate to any other cell until a valid itemcode is entered.
    Is there any way around this?
    Thanks

  • 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 in the system

    Hi
    I want to create the Choose from list in the System form (Employee Master Data) in the edit box. what is the coding for this ? can anyone help me ...
    Regards
    Bhuvana
    Edited by: bhuvana eshwari on Aug 7, 2008 8:23 AM

    Hi
    i am adding three fields in Employe Master Data under Adminstration folder and fourth field in Employe  Master Data,
    Choose from list is added in the fourth field. please see this coding...
    Public Class class1
        Public WithEvents oApplication As SAPbouiCOM.Application
        Private oOrderForm As SAPbouiCOM.Form
        Private oNewItem As SAPbouiCOM.Item
        Private oItem As SAPbouiCOM.Item
        Private oFolderItem As SAPbouiCOM.Folder
        Private oOptionBtn As SAPbouiCOM.OptionBtn
        Private oCheckBox As SAPbouiCOM.CheckBox
        Dim ostatic As SAPbouiCOM.StaticText
        Dim ocombo As SAPbouiCOM.ComboBox
        Dim oCompany As SAPbobsCOM.Company
        Dim oRecordSet, rs1, rs2 As SAPbobsCOM.Recordset
        Dim oSboGuiApi As SAPbouiCOM.SboGuiApi
        Dim nerr As Long
        Dim oedit, oedit1, oedit2 As SAPbouiCOM.EditText
        Dim obutton As SAPbouiCOM.Button
        Dim oform As SAPbouiCOM.Form
        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
        Public Sub setapplication()
            Dim Cookie, EncryptedCookie, Connstring As String
            Dim nerr As Long
            oCompany = New SAPbobsCOM.Company
            Connstring = Environment.GetCommandLineArgs.GetValue(1)
            oSboGuiApi = New SAPbouiCOM.SboGuiApi
            oSboGuiApi.Connect(Connstring)
            oApplication = oSboGuiApi.GetApplication
            oApplication.MessageBox("hi u r connected to the application")
            Cookie = oCompany.GetContextCookie
            EncryptedCookie = oApplication.Company.GetConnectionContext(Cookie)
            nerr = oCompany.SetSboLoginContext(EncryptedCookie)
            oApplication.MessageBox("single sign on worked")
            If oCompany.Connected = False Then
                nerr = oCompany.Connect
                If nerr <> 0 Then
                Else
                    oApplication.MessageBox("Company got connected successfully")
                End If
            End If
        End Sub
        Private Sub AddItemsToOrderForm()
            oItem = oOrderForm.Items.Item("90")
            oNewItem = oOrderForm.Items.Add("s1", SAPbouiCOM.BoFormItemTypes.it_STATIC)
            oNewItem.Left = oItem.Left
            oNewItem.Top = oItem.Top + 18
            oNewItem.Width = oItem.Width
            oNewItem.Height = oItem.Height
            oNewItem.Visible = True
            ostatic = oNewItem.Specific
            ostatic.Caption = "Referal Name"
            oNewItem.FromPane = 3
            oNewItem.ToPane = 3
            oItem = oOrderForm.Items.Item("81")
            oNewItem = oOrderForm.Items.Add("e1", SAPbouiCOM.BoFormItemTypes.it_EDIT)
            oNewItem.Left = oItem.Left
            oNewItem.Top = oItem.Top + 18
            oNewItem.Width = oItem.Width
            oNewItem.Height = oItem.Height
            oNewItem.Visible = True
            oedit = oNewItem.Specific
            oNewItem.FromPane = 3
            oNewItem.ToPane = 3
            oedit.DataBind.SetBound(True, "OHEM", "U_rename")
            oItem = oOrderForm.Items.Item("s1")
            oNewItem = oOrderForm.Items.Add("s2", SAPbouiCOM.BoFormItemTypes.it_STATIC)
            oNewItem.Left = oItem.Left
            oNewItem.Top = oItem.Top + 18
            oNewItem.Width = oItem.Width
            oNewItem.Height = oItem.Height
            oNewItem.Visible = True
            ostatic = oNewItem.Specific
            ostatic.Caption = "ReferalEmp No "
            oNewItem.FromPane = 3
            oNewItem.ToPane = 3
            oItem = oOrderForm.Items.Item("e1")
            oNewItem = oOrderForm.Items.Add("e2", SAPbouiCOM.BoFormItemTypes.it_EDIT)
            oNewItem.Left = oItem.Left
            oNewItem.Top = oItem.Top + 18
            oNewItem.Width = oItem.Width
            oNewItem.Height = oItem.Height
            oNewItem.Visible = True
            oedit = oNewItem.Specific
            oNewItem.FromPane = 3
            oNewItem.ToPane = 3
            oedit.DataBind.SetBound(True, "OHEM", "U_reid")
            oItem = oOrderForm.Items.Item("s2")
            oNewItem = oOrderForm.Items.Add("s3", SAPbouiCOM.BoFormItemTypes.it_STATIC)
            oNewItem.Left = oItem.Left
            oNewItem.Top = oItem.Top + 18
            oNewItem.Width = oItem.Width
            oNewItem.Height = oItem.Height
            oNewItem.Visible = True
            ostatic = oNewItem.Specific
            ostatic.Caption = "Floor"
            oNewItem.FromPane = 3
            oNewItem.ToPane = 3
            oItem = oOrderForm.Items.Item("e2")
            oNewItem = oOrderForm.Items.Add("e3", SAPbouiCOM.BoFormItemTypes.it_COMBO_BOX)
            oNewItem.Left = oItem.Left
            oNewItem.Top = oItem.Top + 18
            oNewItem.Width = oItem.Width
            oNewItem.Height = oItem.Height
            oNewItem.Visible = True
            ocombo = oNewItem.Specific
            ocombo.ValidValues.Add("", "")
            ocombo.ValidValues.Add("FLOOR1", 0)
            ocombo.ValidValues.Add("FLOOR2", 1)
            ocombo.ValidValues.Add("FLOOR3", 2)
            ocombo.ValidValues.Add("FLOOR4", 3)
            ocombo.ValidValues.Add("FLOOR5", 4)
            oNewItem.FromPane = 3
            oNewItem.ToPane = 3
            ocombo.DataBind.SetBound(True, "OHEM", "U_refl")
            oItem = oOrderForm.Items.Item("3")
            oNewItem = oOrderForm.Items.Add("s4", SAPbouiCOM.BoFormItemTypes.it_STATIC)
            oNewItem.Left = oItem.Left
            oNewItem.Top = oItem.Top + 18
            oNewItem.Width = oItem.Width
            oNewItem.Height = oItem.Height
            oNewItem.Visible = True
            ostatic = oNewItem.Specific
            ostatic.Caption = "Referal Details"
            oNewItem.FromPane = 0
            oNewItem.ToPane = 0
            oItem = oOrderForm.Items.Item("33")
            oNewItem = oOrderForm.Items.Add("e4", SAPbouiCOM.BoFormItemTypes.it_EDIT)
            oNewItem.Left = oItem.Left
            oNewItem.Top = oItem.Top + 18
            oNewItem.Width = oItem.Width
            oNewItem.Height = oItem.Height
            oNewItem.Visible = True
            oedit = oNewItem.Specific
            oNewItem.FromPane = 0
            oNewItem.ToPane = 0
            addcfl()
            oedit.DataBind.SetBound(True, "OHEM", "U_refer")
            oedit.ChooseFromListUID = "cfl_1"
            oedit.ChooseFromListAlias = "firstName"
        End Sub
        Public Sub New()
            MyBase.New()
            setapplication()
        End Sub
        Private Sub LoadFromXML(ByRef FN As String)
            Dim oXmlDoc As Xml.XmlDocument = New Xml.XmlDocument
            Dim sPath As String
            sPath = IO.Directory.GetParent(Application.StartupPath).ToString
            oXmlDoc.Load(sPath & "\" & FN)
            oApplication.LoadBatchActions(oXmlDoc.InnerXml)
        End Sub
        Public Sub oApplication_ItemEvent(ByVal FormUID As String, ByRef pVal As SAPbouiCOM.ItemEvent, ByRef BubbleEvent As Boolean) Handles oApplication.ItemEvent
            If pVal.FormType = "60100" Then
                If ((pVal.EventType = SAPbouiCOM.BoEventTypes.et_FORM_LOAD) And (pVal.Before_Action = True)) Then
                    oOrderForm = oApplication.Forms.GetFormByTypeAndCount(pVal.FormType, pVal.FormTypeCount)
                    AddItemsToOrderForm()
                End If
            End If
            If pVal.FormTypeEx = "60100" And pVal.ItemUID = "e4" And pVal.EventType = SAPbouiCOM.BoEventTypes.et_CHOOSE_FROM_LIST And pVal.InnerEvent = False Then
                Dim oCFLEvento As SAPbouiCOM.IChooseFromListEvent
                oCFLEvento = pVal
                If oCFLEvento.Before_Action = True Then
                    oform = oApplication.Forms.ActiveForm
                    Try
                        oCFL = oform.ChooseFromLists.Item("cfl_1")
                        Dim oDataTable As SAPbouiCOM.DataTable
                        Dim oEdit As SAPbouiCOM.EditText
                        Dim Name As String
                        oform = oApplication.Forms.Item("60100")
                        oDataTable = oCFLEvento.SelectedObjects
                        oEdit = oform.Items.Item("e4").Specific
                        Name = oDataTable.GetValue("firstName", 0)
                        oEdit.String = Name
                    Catch ex As Exception
                        oApplication.StatusBar.SetText(ex.Message, SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_None)
                    End Try
                End If
            End If
            If oedit.Value = "firstName" Then
                LoadFromXML("new.srf")
                oform = oApplication.Forms.Item("re_form")
                oform.Visible = True
                oedit = oform.Items.Item("cf1").Specific
            End If
        End Sub
        Private Sub addcfl()
            Dim ocflcreation As SAPbouiCOM.IChooseFromListCollection
            ocflcreation = oApplication.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_ChooseFromListCreationParams)
            ocflcreation.MultiSelection = True
            ocflcreation.ObjectType = "171"
            ocflcreation.UniqueID = "cfl_1"
            oCFLs = oform.ChooseFromLists
            oCFL = oCFLs.Add(ocflcreation)
        End Sub
    End Class
    Regards
    Bhuvana

  • Choose from list for purchase  Item

    Dear Experts,
    i have created Choose from list in matrix using Screen Painter. its working properly but i want to display only Purchase Items in CFL.
    For Customer we are using
    oCons = oCFL.GetConditions()
                oCon = oCons.Add()
                oCon.Alias = "CardType"
                oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL
                oCon.CondVal = "C"
                oCFL.SetConditions(oCons)
    Like this, How to set condition for Purchase items thru coding or Screen painter
    Mathi

    Hi Mathi,
    Try this and tell me if it worked.
    oCons = oCFL.GetConditions()
    oCon = oCons.Add()
    oCon.Alias = "PrchseItem"
    oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL
    oCon.CondVal = "Y"
    oCFL.SetConditions(oCons)
    If this works dont forget to reward points..
    Regards,
    Vasu Natari.
    Edited by: vasu natari on Jul 29, 2008 12:37 PM

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

  • Change data in existing "Choose from list" matrix

    Hi,
      in UI GUI->order form . When add a new order, hit "TAB" to select BP from existing list. I want to use my own sql to populate the BP list (currently the GUI defaults to return all customers).
    Is there a way? I mean if I just want to change data in the matrix and let B1 continue to make the "Choose from list" form (form "10001") with my own new customer list.  Set BubbleEvent = true will just re-read all cards after I query my result.
      any help is appriciated!

    Hello,
    I came across the same issue with the Items Choose from List on the Sales Order screen. It is possible to load your own Choose from List form and populate the matrix using recordset objects and userdatasources. The same logic could be applied to the BP Choose from List form. The following code displays the user form and matrix items - separate code is needed to handle the selection process on this form. There maybe a faster way of acheiving this using UDTs etc but it seems to work ok.
    'When user presses Tab key in Item No. column.
    If pVal.EventType = et_KEY_DOWN Then
    If pVal.ItemUID = "38" And pVal.ColUID = "1" And _
    pVal.Before_Action = True And pVal.CharPressed = vbKeyTab Then
    'Load new Choose from List form.
    'This is actually an exported and edited version of the SBO form.
    LoadFromXML sIIS_ITEMLIST_XML
    'Populate matrix with items returned from SQL query.
    'Use recordset, arrays, userdatasources.
    Set oRecordSet = oCmp.GetBusinessObject(BoRecordset)
    sSql = "Select OITM.ItemCode, OITM.ItemName, OITM.OnHand FROM OITM " & _
        "Where Upper(Left(OITM.ItemCode,2)) = 'B1'"
    oRecordSet.DoQuery sSql
    nRows = oRecordSet.RecordCount
    If nRows <> 0 Then
    'Array declarations.
    Dim ItemCode(), ItemName(), OnHand()
    ReDim ItemCode(nRows - 1)
    ReDim ItemName(nRows - 1)
    ReDim OnHand(nRows - 1)
    'Add userdatasources to form.
    oForm.DataSources.UserDataSources.Add "ItemCode", dt_LONG_TEXT, 20
    oForm.DataSources.UserDataSources.Add "ItemName", dt_LONG_TEXT, 100
    oForm.DataSources.UserDataSources.Add "OnHand", dt_LONG_NUMBER
    i = 0
    'Populate arrays from recordset.
    Do While oRecordSet.EOF <> True
        ItemCode(i) = oRecordSet.Fields.Item(0).Value
        ItemName(i) = oRecordSet.Fields.Item(1).Value
        OnHand(i) = oRecordSet.Fields.Item(2).Value
        oRecordSet.MoveNext
        i = i + 1
    Loop
    'Bind data fields to form items.
    Set oMatrix = oForm.Items.Item("7").Specific
    Set oColumn = oMatrix.Columns.Item("ItemCode")
    oColumn.DataBind.SetBound True, "", "ItemCode"
    Set oMatrix = oForm.Items.Item("7").Specific
    Set oColumn = oMatrix.Columns.Item("ItemName")
    oColumn.DataBind.SetBound True, "", "ItemName"
    Set oMatrix = oForm.Items.Item("7").Specific
    Set oColumn = oMatrix.Columns.Item("OnHand")
    oColumn.DataBind.SetBound True, "", "OnHand"
    'Get data from datasources.
    Dim oUItemCode As SAPbouiCOM.UserDataSource
    Dim oUItemName As SAPbouiCOM.UserDataSource
    Dim oUOnHand As SAPbouiCOM.UserDataSource
    Set oUItemCode = oForm.DataSources.UserDataSources.Item("ItemCode")
    Set oUItemName = oForm.DataSources.UserDataSources.Item("ItemName")
    Set oUOnHand = oForm.DataSources.UserDataSources.Item("OnHand")
    oMatrix.Clear
    'For each returned record in recordset then
    'add row to matrix and populate it from
    'userdatasource.
    For i = 1 To nRows
        oMatrix.AddRow
        oUItemCode.Value = ItemCode(i - 1)
        oUItemName.Value = ItemName(i - 1)
        oUOnHand.Value = OnHand(i - 1)
        oMatrix.SetLineData
    Next i
    End If
    'Show form. This also sets focus to edittext field.
    oForm.Visible = True
    'Don't display standard SBO item list form.
    BubbleEvent = False
    End If
    End If
    Regards,
    Andrew.

Maybe you are looking for

  • HT4437 streaming .mov to apple-tv via airplay

    Hi, I would like to stream a streaming .mov movie via airplay to my Apple TV3 box. how can I do that, since I cannot place the movie-file into iTunes as suggested in support forums. (streaming movie URL = http://hstreaming.zdf.de/zdf/veryhigh/130107_

  • Error when creating spatial index in 10g

    Hello. I have a problen when I try to create a spatial index. The strange thing is that the same commands always works fine in some machines, but if always fails in others. I tryed in diferent versiones of Oracle, but I have the error in al of them.

  • HT1349 How to unlock my iPad when some else usesd a passcode

    How can I unlock my ipad after someone else have put a passcode on it.

  • Satellite A210-13f - Which laptop cooler pad do you recommend?

    Hi everyone, Ive had a Satellite A210-13f notebook for a year. \ Right now Im looking for a cooler for it. Ive noticed my laptop has a fan underneath and Im wondering if all laptop coolers (thermal take, cooling master...) are appropriate for it. Als

  • Wrong credentials entered during Client update

    Hi, We have a production site where ODS transfer have stopped working after an upgrade from 6.0.4.12 to 6.0.4.18. I am suspecting that the wrong database credentials have been given during client upgrade and I want to change them to make sure they ar