View Article

Configure a Form with a User Control

By Xelence Documentation posted 12-23-2021 12:38

  

Introduction

There may be a business need to add the same set of fields on multiple forms. For example, you may have Supplier and Product Maintenance forms. You may want to add the supplier details to these forms to indicate who the product belongs to. In such cases, you can configure a user control with the fields you always want to display and add that control to any desired form. This is ideal if you have one template layout that works for multiple forms.

This example creates a user control, configures a maintenance form with the user control, and configures opening the maintenance form from another form.

Prerequisites

  • The entSupplier and entproduct entities must already exist.
  • One-to-one relationship must exist between the entproduct and entSupplier entities.
  • One-to-many relationship must exist between the entSupplier and entProduct entities.
Quick Steps
1 Click the Create New File icon, then select New Page
2 Click More, select User Control, then click Proceed
3 Roll over the Form Layout and click Choose
4 Enter the details, then click Finish
5 Add the controls
6 Change the controls to labels
7 Save the form
8 Open the desired form
9 Add a collapsible control
10 Add the user control
11 Enter the details, then click OK
12 Save the form
13 Open the parent form
14 Add a New button
15 Add an Open button
16 Save the form

Detailed Steps

Step 1. Click the Create New File icon, then select New Page.

This opens a drop down from which you can select an object to begin with. 



Step 2. Click More, select User Control, then click Proceed.



Step 3. Roll over the Form Layout and click Choose.

Choose the layout based on how you want it to look to users. This example uses the default user control layout.



Step 4. Enter the details, then click Finish.

These are required user control properties:

  • Entity: The fields available to the user control will be based on this entity's attributes.
  • ID: Programmatic ID of the user control. It populates automatically, but the user can modify it. It will always be prefixed with udc.
  • Folder: Specifies the location for the user control. 
Clicking Finish creates the file. It is ready for further configuration.

The user control is ready for further configuration.



Step 5. Add the controls.

These are the fields from the Supplier entity. You are going to add the user control on the Product Maintenance form. These fields will identify with whom the product is available.



Step 6. Change the controls to labels.

This example uses labels for all the fields. This is common for fields that display on multiple forms.



Step 7. Save the form.



Step 8. Open the desired form.

Open the form where you want to add the user control. This example uses the Product Maintenance form.



Step 9. Add a collapsible control.

This example places the supplier details in a collapsible control via the user control. Select a one cell layout.



Step 10. Add the user control.



Step 11. Enter the details, then click OK.

These are required user control properties:

  • ID: Programmatic ID of the user control. It populates automatically, but you can modify it.
  • Active Form: The user control form that will be displayed. In this example, it is udcSupplierUserControl.
  • Entity Field: Specifies the associated one-to-one relationship object. In this example, it is objSupplier.
  • Resources: Security property that determines who can access the user control.



Step 12. Save the form.



Step 13. Open the parent form.

This example adds buttons to the Supplier Maintenance form to navigate to the child Product Maintenance form.



Step 14. Add a New button.

Drag and drop a New button next to the Delete button. Complete the wizard to place the button.

Important button properties are:

  • ID: Programmatic ID of the button.
  • Visible: Determines whether the user can see the button.
  • Text: Make sure the user clearly understands what this button does, as opposed to all the other buttons. In this case, it is New Product Record.
  • Active Form: The form that the button opens when clicked. In this case, it is wfmProductMaintenance.

This button will create new Product records.



Step 15. Add an Open button.

Drag and drop an Open button. Complete the wizard to place the button.

This button has all the same properties as a New button, except that it needs a related control (data table whose record it'll open in the form).

This button will open existing Product records.

The buttons you need to navigate to the Product Maintenance form have been added to the Supplier Maintenance form.




Step 16. Save the form.


Then, run the Preview. Xelence displays the form output. You can test your updated settings.

When you have previewed your form, it should look something like this. You can open or create the Product record from the Supplier form and view the supplier information on the Product Maintenance form.


What are the improvements over S3 Version 6?

This process is identical.


Related Articles

Create a Maintenance Form

Create a Child Maintenance Form and Configure Opening it from the Maintenance Form 

Configure a Form with a Tooltip 


This post is part of the Maintenance Form topic. Click here to open the Maintenance Form Overview.


#Xelence

#Forms

0 comments
96 views