Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Step 1 – Add Attributes to Client Business Object

  1. Go to the Client business object and add a new attribute Age of type Number
  2. Save the Attribute
  3. Deploy you solution; log out and then log in.

Step 2 – Changing the Modify, Detail, and New Client Screens

  1. Add an Age NumberField to the Modify and New Client screens; make sure the field is bound to the attribute in the storeClients store
  2. In the Modify and New Client screens also change the Department field to a Combobox by adding the following code in place of the Textfield

    Code Block
    <ext:ComboBox runat="server" HiddenName="Department1_Value" FieldLabel="Department" AutoRender="False" ID="Department1">
    <Template ID="XTemplate1" EnableViewState="False"></Template>
    <Items>
    <ext:ListItem Text="Professional Services" Value="Professional Services"></ext:ListItem>
    <ext:ListItem Text="Solution Delivery" Value="Solution Delivery"></ext:ListItem>
    <ext:ListItem Text="Engineering" Value="Engineering"></ext:ListItem>
    <ext:ListItem Text="Quality Assurance" Value="Quality Assurance"></ext:ListItem>
    </Items>
    </ext:ComboBox>
  3. In storeClients make sure all the new fields are connected to attributes of business object Client.
  4. To the Detail screen, simply add an Age label and also tie it back to the store.
  5. The altered pages should look thus:
  6. Make sure the pages are saved and deploy the solution; log out and log in. 
  7. Go to the application and add age and department data to several of your clients.

Step 3 – Create a View

  1. In the Navigation Library, go to Data Management and then go to Views 
  2. Click New View and call it Age View; set Primary Object to Client; click Save
  3. Click on the Fields tab and move FirstName and Age to the right-hand panel
  4. Click on the Where tab
    1. Click Add Term
    2. Set Type to Compare
    3. Under Expression 1 set Field to Age
    4. Set Operation to Greater or equal
    5. Under Expression 2 set Constant to Number 30
    6. Click Save at the top left of the screen
    7. The SQL code at the bottom of the page should look like this: select A0.COL_ID ID, A0.COL_FIRSTNAME CLIENTFIRSTNAME, A0.COL_AGE CLIENTAGE from TBL_CLIENT A0 where (((A0.COL_AGE >= 30)))
    8. Click Save at the bottom right of the page
  5. Deploy your solution; log out and log in again

Step 4 – Create a View Page

  1. Create a new page called Age View
  2. Add a Unified Store called storeAgeView
    1. In properties set Data Source Type to Business Views
    2. Set Data Source to Age View
    3. Check the List checkbox
    4. Click Save
  3. Drag a Grid into pnMain and call it grdAgeView
    1. Click on Settings and set Data Source to storeAgeView[list]
    2. Move the ClientFirstName and ClientAge columns over to the right
    3. Change the header of ClientFirstName to First Name and of ClientAge to Age
    4. Check the AutoExpand checkbox in ClientAge; click Apply
    5. In the General tab, check the Use Paging checkbox and select Row Selection in the Selection Model; click Apply and Save
    6. Click on Preview to preview your page.
    7. Click Save Page at the top left of the screen. 
    8. Attach your page to your application and deploy; log out and log in to find the page in your application
  4. The result should be this: