How can I make entry in the phone field required on the account edit page but not on the create page in Sales in the Redwood User Experience?
You can make entry in the phone field required by creating a field template where the entry is required and mapping the new template to the phone field on the page.
Here's how to make the phone field required on the account edit page:
- Open Oracle Visual Builder Studio.
- Create a field template that makes the entry required:
- Click the Layouts tab.
- Open the Sales node and click Accounts.
- Click the Templates tab in the right pane.
- On the Account Phone Template, click the
Actions menu (three dots) and select
Duplicate.
- In the Duplicate Template dialog, Label field, enter a name such as Account Phone Required Template.
- Optionally, change the ID and enter a description.
- Click the Duplicate button.
- Edit the duplicated template. (Click Actions (three dots menu on the right side) and select Edit).
Click the Code button to view the template code.
- Insert the following parameter in the
code:
<oj-vb-fragment-param name="required" value="[[ true ]]"></oj-vb-fragment-param>
- Duplicate the edit page layout and associate the new field template to the field:
- Click the Layouts tab.
- Open the Sales node and click Accounts.
- On the Account tab in the right pane, click the Rule Sets subtab.
Click the Edit Layout layout to open the rule set display logic.
- In the Display Logic tab, duplicate the isDefaultEdit rule.
Leave the Also create a copy of the layout option
selected.
- Click Open on the copy you just made. (Hover over the return field to see the icon.)
Click the Phone field and then click the Override link in the Show Field panel.
Select the new template.
You can preview the page using the Preview button. The phone field should have the Required label. Saving is disabled unless you make an entry.