Part 3: Add a Lookup field

From AgileApps Support Wiki
Revision as of 09:36, 1 December 2022 by Wikieditor (talk | contribs) (Created page with "In this part of the exercise, you create a field in the Orders Object to show the total price for all Line Items in an order. # Create an Index in the Line Items Object: ## Go...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

In this part of the exercise, you create a field in the Orders Object to show the total price for all Line Items in an order.

  1. Create an Index in the Line Items Object:
    1. Go to the Configuration page, under the Customization tile, navigate to Objects > Line Items.
    2. Select Indexes > New Index.
    3. For the name, type OrderIndex. For the field, select Order.
    4. Save the index.
      Note: The Index in the Line Items Object is required to create a Rollup Summary field in the related Order Object.
  2. Create a Lookup field inside the Orders Object named Line Items Lookup that points to the related Line Items Object:
    1. Go to the Configuration page, under the Customization tile, navigate to Objects > Orders.
    2. Select Fields > New Field. Fill-in the values as shown:
    3. Click Save.
  3. Add a Rollup Summary field inside the Orders Object named Total Order Price to sum up the calculated Total Prices of all related Line Items for an order:
    1. Go to the Configuration page, under the Customization tile, navigate to Objects > Orders.
    2. Select Fields > New Field. Fill-inFill in the values as shown:
    3. Click Save.
  4. Open the Orders Default Layout Form:
    1. Note that the new Total Order Price field has been automatically added to Basic Information section.
    2. Remove the Line Items Lookup Lookup field from the Basic Information section.
    3. Save your changes.
  5. Open the Line Items Default Layout Form. Remove the Orders Lookup field from the Related Information section.
    Save your changes.
  6. Test your modifications by adding a new order with three line items. Ensure the Total Order Price field gets filled.
    Note: As Rollup Summary fields are calculated asynchronously in the background, the value might not be filled immediately.