How can I add the attachment field to the Edit pages in Oracle Sales in the Redwood User Experience?
Here's how you can use Oracle Visual Builder Studio to incorporate an Add Attachment button on Edit pages, enabling salespeople to add and view attachments directly from those pages. By default, salespeople can add attachments by entering Show attachments in the Action Bar. While we're using the Edit Lead page as an illustration, the same setup process is applicable to other sales objects as well.
- Open the Leads list page (or the list page of another sales object).
- Drill down into a record and click the Details button to open the edit page.
- In the Settings and Actions menu, click Edit Page in Visual Builder Studio.
- Click the Layouts tab (callout 1 in the screenshot)
- Open the Sales node and click Leads or another object (callout 2).
Under the Dynamic Form heading, click Edit Layout or another layout where you want to add the field (callout 3).
-
In the Display Logic section, click Duplicate Rule on the default layout to create your own layout.
- In the Duplicate Rule dialog box:
- Optionally, enter a different name.
- Leave the Also create a copy of the layout option selected.
- Click Duplicate.
On your duplicate, click Open (the icon highlighted in the following screenshot)
-
On the Fields tab, search for Attachments (callout 1 in the following screenshot) and select the attachment field at the top of the list.
Note: The field name is slightly different for each object. For leads, the field name is AllLeadAttachments. For accounts, it's Attachment. - Select and drag the field to the desired location in the Select fields to display section (callout 2).
With the attachment field selected (callout 3), click the Create link next to the Template field in the right pane to create a field template (callout 4).
- In the Create Template box, enter a Label for the template, for example Attachment Button and an ID such as attachmentButton.
- Leave the Enable Extensions checkbox selected.
- Click Create.
- In the Templates subtab, edit the template you just created.
- Between the Template tags, paste in the following
code:
<oj-vb-fragment name="oracle_cx_fragmentsUI:cx-attachment" bridge="[[ vbBridge ]]" :id="[[ $fieldName + '-' + cxcore.utils.generateUID() ]]"> <oj-vb-fragment-param name="dynamicLayoutContext" value="[[ $dynamicLayoutContext ]]"></oj-vb-fragment-param> <oj-vb-fragment-param name="style" value="[[ 'AttachmentButton' ]]"></oj-vb-fragment-param> </oj-vb-fragment>
Your attachment template code should look similar to this:
- Click Preview at the top of the page to test the button you added on the page.