In this article, we are going to look at how a lookup can be auto generated when a field in child entity which is related to a field in parent entity is dragged onto the form designer. This is more of a usability feature.
Before we get into the details, lets first understand what is a lookup. As you type in a text box, a dropdown of suggestions automatically populates based on the entered text. Same applies in case you wish to populate a dropdown control with a list of values managed externally. This feature provides the end user with a list of values to select from in a text box or dropdown, which otherwise the user would have manually typed-in.
When you are working with a parent-child entity on same form, since past many releases, AgilePoint intelligently handles the case where as you keep adding records in child entity, the child entity is made auto aware of the related field in parent entity. For e.g. if you are creating a new order for a customer, the customer id field which is on Order entity acts as reference to customer and this field is auto populated even if you do not have such field on your form as the form is already aware of the parent entity context.
However there are cases when your form might only be dealing with fields from child entity for e.g. Orders and has no fields belonging to parent entity i.e. Customers is there on the form. In this case, it is not possible for eForms to automatically figure out the customer id to be associated with order. So as a form designer, you need to have Customer Id field on the form.
However most people do not memorize id’s. So you need to create lookup which shows customer name as a selectable field and corresponding id is stored as value behind the scene. This lookup had to to be previously created manually.
AgilePoint NX 7.0 SU2 provides a new control, Single Select Lookup, in eForms designer to help auto generate this lookup. Lets understand this with an example. Consider the Customer entity and Order entity example again. At design time, the from designer will bind the ‘Customer Id’ field of the Order Entity to the Single Select Lookup control. At run time, when an Order’s data (i.e., ‘Order Entity’) is being edited/entered, as the person select the search button next to Customer Id, the system will automatically lookup into the ‘Customer Name’ values from the ‘Customer Entity’. User is shown list of Customer Names to select from but when a ‘Customer Name’ is selected, it will store the corresponding Customer Id in the Order entity record as expected.
- For the form/web designer this control saves application design time of building the lookup feature.
- For the end user, it saves time and increases accuracy of input data, as the user only selects data value from a prepopulated list of values.
- The end user is also saved from the burden of remembering the correct input values as the same is now available as a lookup.
Note: The entity being edited and the related entity being looked up, need to originate from the same data source for this feature to work.
Please refer to a short video on how this feature works