Skip to main content

How to Bring back Data from an Adapter

Sometimes when you work on a customization you will need to retrieve some data from other table and to bring it to your form you will use the adapter of this table.

Let suppose you want to bring a part data (Part number, Part description) to your customization and you want to let the user to search for a part using the search dialog window.

I will show you how to do this easily.

·         Add the below controls from the Toolbox to your form:
        o   EpiButton and set the Text properties to “Part…”.
       Two EpiTextBox and bind them to an available UD fields in your table (The table which I used in 
                  my customization is UD107 will use Character01 and Character02 fields).
             o      EpiLabel and set the Text properties to “Description”.
·         Arrange them to look like the below:



·         You want to bring the data from Part Adapter using search dialog window.  
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 PartAdapter from the adapter list and then click Next button.



·         The choose Search Dialog  radio box and then select partNum field from Search Fields drop down list and select the Data View which you are working on in your customization ( For me UD107) and then select Character01 from Fields drop down list then click add button.


·         Repeat the last step to link PartDescription to UD107.Character02 and then click finish.

·         The SearchOnPartAdapterShowDialog method will be added automatically into the code editor.
This method open the search dialog window and allow the user search for a part and when the user choose the part from the result and press ok the partNum and PartDescription data will fill automatically in the text boxes.




·         You have to call this method from another method in custom code and will call it when the user clicks on the button which we added it in the first step. So first add the click method for the button ass below:



·         The Click method code will be added automatically in the code editor and to call the SearchOnPartAdapterShowDialog method add the below code into button click 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. Thanks!

    I have a small query I hope you can help me. I have one Customized field in Quotation which stores the list of sellers we have, where we can select the seller name for whom we are making the quotation. My concern is that we need to pull the email ID of the same seller in our quotation window so that we can send email from epicor itself when quotation is created.

    ReplyDelete
  2. You can store the sellers data (Name (CodeID) and Email(CodeDesc)) in the User Codes table and then you will write a BAQ to retrieve the email by name from UDCode and UDCodeType and in your c# you will call the BAQ.

    To access the user codes:
    System Management -> Utilities -> User Codes

    ReplyDelete
  3. Hi Waleed,
    Is it possible to show an example using an adapter to bring back a dataset to bind to a grid? Thanks!

    ReplyDelete
  4. I want to get into an adacter the UD107 Childs.

    Is that possible?

    ReplyDelete

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.