Skip to main content

How to Fill up EpiUltraCombo Using Code from another table

 Sometimes when you work on a customization you will need to fill up EpiUltraCombo control from another table.

I will show you how to do this easily.

·         Add EpiUltraCombo from the toolbox and bind to the available UD field.

·         You want to bring the data from an Adapter and fill up the combo.  
From the main menu of the customization tools dialog window select Tools => Wizards => Customization Wizards as below:


·         The Customization Code Wizard dialog window appears.
Select Simple Search and click Lunch Wizard button.

·         The Simple Search Wizard window appears.
Click Get Adapters button to retrieve all adapters and then choose the adapter (Here I will select UOMAdapter) and then click Next button.


·         Leave the “DropDowm” radio box checked and then select your UltrCombo name from the “Custom DropDown” drop down list and then select the Value and Display field for the UltraCombo and press finish.


·         This above step will add “SearchOnUOMAdapterFillDropDown()” method to the custom code.


·         You have to call this method from another method in custom code and I will call it in the Form_Load method.



·         From the main menu of customization tools dialog window select Tools => Test code or Press F5 for test your code.
·         If the code tested successfully then save the Customization and close all windows.
·         Reopen your customization and test your customization by adding a new line.



Comments

  1. Any way to filter by rows? We have a UD table with categories that we want in the dropdown.

    ReplyDelete
    Replies
    1. You can add a line of code under Dim whereclause As String = String.Empty that sets the whereclause variable to whatever you require in the same format as SQL.

      Example:

      This is using the Customer adapter but will work for any adapter. You will notice that I am getting a dynamic variable from a field on the screen after it has been populated, but you quite easily hard code this also:

      Dim recSelected As Boolean
      Dim whereClause As String = String.Empty
      whereclause = String.Format("GroupCode = '" & txtImportCusGroup.Text & "'")

      Dim dsCustomerAdapter As System.Data.DataSet = Epicor.Mfg.UI.FormFunctions.SearchFunctions.listLookup(Me.oTrans, "CustomerAdapter", recSelected, false, whereClause)

      If recSelected Then

      ' Set EpiUltraCombo Properties
      Me.NewCRGeneralcbo2.ValueMember = "CustID"
      Me.NewCRGeneralcbo2.DataSource = dsCustomerAdapter
      Me.NewCRGeneralcbo2.DisplayMember = "Name"

      Dim fields() As String = New String() {"Name"}
      Me.NewCRGeneralcbo2.SetColumnFilter(fields)

      End If

      Hope this helps.

      Many thanks,
      Adam Treadwell
      ERP Manager - Aerospace Division
      Sigma Precision Components UK Ltd
      Adam.Treadwell@SigmaComponents.co.uk

      Delete
    2. As per my above code, you can add a condition to whereClause in the "SearchOnUOMAdapterFillDropDown()" method.

      Delete

Post a Comment

Popular posts from this blog

Epicor 9 ToolBars

Like any other application, Epicor has list of toolbars and it uses the Infragistics controls and you can modify these toolbars in your code by adding new tools or change the properties for the existing toolbars and Tools.

How to Use the Business Activity Query Export Process

Business Activity Query Export Process let you export the BAQ data in XML or CSV format. You can export the BAQ data manually and you can schedule it to run automatically (Daily, Weekly, ,Monthly,Once,startup..etc) and you can configure this in the “system agent maintenance” and I will explain this later in this article.