Design Options

From AgileApps Support Wiki

The platform frequently provides multiple ways to get the job done. This page provides an index of options for common tasks, and provides guidelines for choosing.

Copying Data from Another Record

  • If you have a Lookup field that targets a record you want to copy from, you can automatically copy the data as part of the Lookup settings. This mechanism works for simple data fields like text, number, and dates. When the user selects a Lookup target, the field data is automatically copied.
Learn more: Lookups#Copy Data
  • If you have more complex data like formula calculations or attachments, you can put a Rule in a Rule set, and invoke that Rule Set whenever a record is added or updated. In this case, you define the rules on the object you want to copy from, and then update the record you want to copy to.
Learn more:
  • To copy complex data from a target record, add post-selection JavaScript to the definition of the Lookup field.
Learn more: Post Selection JavaScript#Copy a Field from Another Record

Summarizing Data from Multiple Records

  • Add computations to a report
  • A computation in a report does not change the structure of the object, so it does not require any special design privileges. It can be defined by any user when creating or modifying a report.
  • However, a useful computation may wind up being replicated in multiple reports, and such computations are available only when the report is run. So a summary of order-item amounts would not be available when a viewing an Order record, for example. In addition, to get the summary for one set of records, the summary for all sets of records is calculated.
  • In general, then, report computations is most useful for data that does not need to be seen when examining an individual record. (For example, the total of orders for a given date, or for a given state.)
Learn more: Reports#Compute
  • Calculate record summaries as related records are added and updated
  • A subform allows summary data like sum, average, maximum, and minimum to be calculated as records are added or updated--for example, when adding related Order Items to an Order. (The records can also be sorted on a selected column.)
  • This is the most computationally efficient way to summarize data and store it in a record.
  • It's limitation is that the calculated values are accurate only so long as the subform is used to add or change records.
  • If APIs are used to add or change records, or if changes are made to the related records directly (for example, by adding a record to the OrderItems object, rather than adding it through the subform in an Order record), then the calculated values are no longer accurate.
  • In addition, it provides column totals only. Other calculations like average, max, and min, are not available.
Learn more: Subforms
  • Summarize data in related records
  • --works for formula fields with a numeric return type, as well as numeric fields
  • --works for number w/decimal and percentage, as well as number and currency
  • --does not work for Boolean or Date fields
Synchronous
  • --always accurate
  • --compute-intensive
  • --To ensure maximum performance, a Service Provider may make them unavailable in a hosted installation
  • --available in AgileApps cloud
Asynchronous
  • --occurs in background, but may not be accurate for short periods of time (as determined by Service Provider, not tenant)
Learn more: Rollup Summary Fields
  • Summarize data in arbitrary records
  • --can be used for unrelated records (no lookup required)
  • --calculated only when the record that contains the function is updated
  • --does not automatically reflect changes in the other records
  • --work only for a small set simple numeric fields only
- number, currency, and boolean for SUM and AVG
- number, currency, date for MAXIMUM and MINIMUM
  • --Does not work for formula fields that return a numeric type
  • --Use these to operate on Boolean and Date values
Learn more: Aggregate Functions