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…”.
o Two EpiTextBox and bind them to an available UD fields in your table (The table which I used in
o EpiButton and set the Text properties to “Part…”.
o 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”.
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.
Thanks!
ReplyDeleteI 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.
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.
ReplyDeleteTo access the user codes:
System Management -> Utilities -> User Codes
Hi Waleed,
ReplyDeleteIs it possible to show an example using an adapter to bring back a dataset to bind to a grid? Thanks!
I want to get into an adacter the UD107 Childs.
ReplyDeleteIs that possible?