Wednesday, October 26, 2016

Creating an Application in Oracle Max - Part 3 Adding the Accounts Tab

In this step, you'll add a tab that displays some basic information about the account related to the selected opportunity
  1. Navigate back to the Opportunity screen by first clicking Screen Flow in the left navbar.The Screen flow tool shows you all of the screens that you've created so far. Double-click the Opportunity snapshot in the screen flow to open the Opportunity screen in the Preview. 
  1. In the Preview, click the Accounts tab.
    1. Double-click Add Component in the Preview to open the Components Palette.
    2. Select the Form component in the Components Palette.
    3. Drag the Form component into the Preview.
  1. In the Properties Inspector, click QuickStarts and then click Add Data. Complete the Add Data QuickStart as follows:
  2. Choose Opportunity in the Select Data Source page and then click Next.In the Data page, first expand the account field. 
  1. Drag the Account fields into the Form Component Fields section in the following order:
    1. name
    2. website
    3. address
    4. city and state -- create a concatenated field by dragging these two into the same field.
    5. country and region (another concatenated field)
      When you're done, the Data page should look like this

  1. Next, Next. In the Query page, click Finish. (You don't need to filter the returned data.) 
All done. Now let's add the Notes tab 
In this step, you'll create a list of notes for each opportunity that are written by various app users. Each list item identifies the notes' author by app user name
  1. In the Preview, click the Notes tab.
  2. Double-click Add Component to open the Component Palette.
  3. Drag a list component into the lower pane of the Preview.
  4. The Properties Inspector for the List component should be open.
  5. Go into the Add Data, and the layout appears
  6. You don't need all of the list fields, so choose the option that includes only the Title, Subtitle, and Value 1 fields and then click Next.
  1. In the Data Source page, choose the Opportunity Notes business object
  2. Map createdate to title, Comment to SubTitle, and username to Value1 
Click Next and Finish 
Now let's add the Create Note Screen. 
In this step, you'll create a form that enables users to jot down notes for a selected opportunity




  1. In the Preview, select the screen component by clicking the Opportunity header.In the Properties Inspector for the Screen component, click Header Buttons.
  2. In the Header Buttons panel, click Button. Enter Create Note in the Button Label field. 

  1. Click Action in the Properties Inspector.
  2.  Click Add Action.
  3. Choose Tap.
  4. Click Navigate to Field.

CLick Tap 
  1. Click Navigate to Screen.
  1. Put it in the DRAG AN ACTION HERE slot.
    1. Click Add
    2. In the Screen type page, pick Create and then click Next.
  2. In the Title page, enter Create Note and then click Next.
  3. Choose Opportunity Notes (the business object that you picked to populate the List components in the Notes tab) from the Business Object menu and then click Next.
  4. Click Finish to return to the Action tab. 
  5. Click Navigation Data Mapper.

  1. From the Current Screen category (which should be open by default), drag oid into both of the Oid fields.
  2. Click Finish and then click Save in the Action tab.
    You'll revisit the Navigation Data Mapper when you plot the interactions within the screen flow.
  3. Click Go to Create Note.
  4. The CRM service populates Comment and Username as the input fields in the form. Since you're going to display the name of the logged in user in the Notes tab, you don't need the user to add his or her name here. To remove the Username field, first right-click it in the Preview and then choose Delete.
  5. Right now, the Comment field is only a single line, so it might not provide enough space for users to enter notes. To make it easier to use:
    1. Open the Properties Inspector for the Comment field by either double clicking it in the Preview or by clicking Comment in the Properties Inspector.
  6. Right now, the Comment field is only a single line, so it might not provide enough space for users to enter notes. To make it easier to use:
    1. Open the Properties Inspector for the Comment field by either double clicking it in the Preview or by clicking Comment in the Properties Inspector.
    2. Add some helpful text in the Hint field, like Type your comments here....
    3. Increase the number of rows to 10. 
    4. Open the Properties Inspector for the Comment field by either double clicking it in the Preview or by clicking Comment in the Properties Inspector.
    5. Choose Text Area as the screen type.
      1. Add some helpful text in the Hint field, like Type your comments here....
      2. Increase the number of rows to 10. 
  7. In addition to navigation actions, MAX also provides business actions, like the ones that refresh data. You can't edit these actions, but by using the Business Action Mapper, you can change the custom business actions that have been created as part of the service. In this step, you'll change the custom action called Create Opportunity Notes so that your app users' names appear next to the notes that they create.
    1. Select the screen component for the Create Note page by double-clicking the header bar in the Preview.
    2. Click Create Opportunity Notes. This is a custom action for the Opportunity Notes business object.

  1. The Configure Business Action Parameters page reveals how the Create Opportunity action enables the Create Screen to interact with Notes tab: it tracks new notes using the Opportunity ID (oid) from the parent Opportunity screen and it maps the values from the Create Notes' Comment and Username fields. The Create Notes screen has only one input field (Comments); app users can't enter their names here. To allow the name of the current user populate the list in the Notes tab alongside the comment that's entered in this screen, you'll need to change the parameter mapping.
Click Configure Business Action Parameters. 


Remove the string from Username
Expand the Application User category.
Drag User Name into the Username field to populate the screen with the name of the current 
app user.
Click Finish and then click Save after you return to the Configure Actions page.

Ok that's enough in this blog. In the next entry we will add the Accounts Screen Flow. 

No comments: