How do I modify field and region properties on a Redwood page?
A Redwood application is designed to provide a comprehensive set of features to meet a wide range of business requirements. For example, managing a user's passport information. In addition, you can make changes to your application to best fit your specific business needs. For example, show or hide fields, make them read-only or required, or even show or hide entire regions of a page. You implement all of these modifications using business rules in Visual Builder Studio in Express mode.
We start signed in as a user with the application administrator role, giving us access to Visual Builder Studio. First, we navigate to the page we want to modify. In our example, we'll modify the Identification Info page. In the Passport section, we’ve been asked to make the Issuing Location field read-only, hide the Profession field, and make the Expiration Date field required. Finally, since our company doesn’t use it, we need to hide the Driver’s license region. We’ve been asked to ensure that these changes only apply when users are viewing their own records.
Use the Settings and Actions menu to start Visual Builder Studio. If it's your first time using it, you may be asked to create a project. For this demonstration, I already have one prepared.
In the Settings and Actions menu, select Edit Page in Visual Builder Studio.
Now that you've started VB Studio, verify that you’re in Express mode.
To change the display properties of fields or regions, you need to adjust your business rules.
Click Configure Fields and Regions to navigate to the rule editor.
Notice that Oracle already provides you with a large number of built-in rules that determine default behavior. If one of these existing rules is similar to your business requirements you can duplicate it and modify the copy to save time. For our quick proof-of-concept we’ll create a new rule that overrides that behavior. The great thing about business rules is that the override will only apply to the fields you modify; all other fields will continue to have their default behavior.
Add a rule and give it a descriptive name. A description of exactly what you’re doing is also helpful.
If necessary, click the Full screen icon.
In the Form Rules section, click the Add icon.
In the Label field, enter Employee passport and driver’s license updates.
In the Description field, enter Make Issuing Location read-only, hide the Profession field, make the Passport Expiration Date required, and hide the Driver’s license region.
Click Create.
First, we’ll set the conditions. By default you can specify the roles, countries, and viewing conditions for which the rule applies. You can add additional conditions based on field values on the page, user information, or use advanced expressions using the expression builder or even some limited JavaScript. Some pages even support using initial values as conditions. For our requirement, we set View own record as our only condition.
Click in the Conditions region.
In the When is the rule applied? row, enter Viewing own info and select the search result with that value.
Click Done.
Now it’s time to make our modifications. To find an element, you can either search for it manually, or use the convenient filter box at the top of the page.
In the Filter field, enter Issuing Location.
Expand the Passports region.
For available elements, you may be able to set them to be required, hidden, or read only, or default a field value using the Value property. The available settings depend on the element. In our case we set it to Read Only. This will override the default settings for that element.
In the Issuing Location row, in the Read Only drop-down, select Read Only.
You can review information about your override and the default settings, or remove the override to restore the default.
In the Issuing Location row, click the Information icon.
Expand the Read Only list to see that there is now a Remove Override option.
We’ll do the same thing for the other elements, but we’ll do it more quickly because the settings are similar.
In the Filter field, enter Profession.
In the Profession row, in the Hidden drop-down, select Hidden.
In the Filter field, enter Expiration Date.
In the Expiration Date row, in the Required drop-down, select Required.
In the Filter field, enter Driver’s license.
In the Driver’s license row, in the Hidden drop-down, select Hidden.
Once you’re done, you can select the check box to verify that you’ve only changed the elements you intended to, and you’ve changed all of them.
Clear the filter.
Select the Show only fields with overridden properties check box.
It’s time to preview your results. You can either maximize the preview panel and review your results there, or use the Preview button to preview the application in a separate browser tab.
Click the X in the upper right corner to close the Rules Editor.
Verify your modifications. In a real test you would also preview the results by reviewing another person’s Identification Info page, for example, as an administrator.
Once your testing is complete, publish your changes and you’re done.
Click Publish.
You’ve used a business rule to modify field and region properties using VB Studio in Express mode. Thanks for watching!