Represents a single row of sales performance data recorded against a sales data series, covering one participant and one reporting period. A record carries an amount plus up to fifteen custom fields (whose names and order are defined by the owning series) and up to five free-text tags, and is scoped to the organisation that collected the data. Records are entered manually, imported from CSV uploads, or created by integrations, and are later matched against other records, scored against targets, and used to allocate reward points; a record's rewards issued date is set once points have been generated from it. The class also exposes a large set of static finder and aggregate query methods (sum, average, minimum, maximum, count) used for reporting and leaderboards across a series.
Group: Database Entities
Implements: Serializable, Auditable
Properties
| Property | Returns | Description |
|---|---|---|
| amount | BigDecimal | The numeric value recorded for this sale, in the units defined by the owning series (for example a currency amount or a count). This is the value summed, averaged and compared against targets in reporting. |
| auditOrg | Organisation | The organisation that audit entries for changes to this record are recorded against, which is the collecting organisation. |
| collectorOrg | Organisation | The organisation that collected this sales data, which is the same organisation that owns the parent sales data series. Used to scope audit records and access control for this record. |
| dateEntered | Date | Date and time the record was entered or imported into the system. This is distinct from the reporting period the record covers. |
| enteredBy | Profile | The profile who entered or imported this record, for audit purposes. This is not necessarily the participant the sale is attributed to. |
| field1 | String | The value of custom field 1 (of up to fifteen) for this record. Field names and order are defined by the owning series. |
| field10 | String | The value of custom field 10 (of up to fifteen) for this record. Field names and order are defined by the owning series. |
| field11 | String | The value of custom field 11 (of up to fifteen) for this record. Field names and order are defined by the owning series. |
| field12 | String | The value of custom field 12 (of up to fifteen) for this record. Field names and order are defined by the owning series. |
| field13 | String | The value of custom field 13 (of up to fifteen) for this record. Field names and order are defined by the owning series. |
| field14 | String | The value of custom field 14 (of up to fifteen) for this record. Field names and order are defined by the owning series. |
| field15 | String | The value of custom field 15 (of up to fifteen) for this record. Field names and order are defined by the owning series. |
| field2 | String | The value of custom field 2 (of up to fifteen) for this record. Field names and order are defined by the owning series. |
| field3 | String | The value of custom field 3 (of up to fifteen) for this record. Field names and order are defined by the owning series. |
| field4 | String | The value of custom field 4 (of up to fifteen) for this record. Field names and order are defined by the owning series. |
| field5 | String | The value of custom field 5 (of up to fifteen) for this record. Field names and order are defined by the owning series. |
| field6 | String | The value of custom field 6 (of up to fifteen) for this record. Field names and order are defined by the owning series. |
| field7 | String | The value of custom field 7 (of up to fifteen) for this record. Field names and order are defined by the owning series. |
| field8 | String | The value of custom field 8 (of up to fifteen) for this record. Field names and order are defined by the owning series. |
| field9 | String | The value of custom field 9 (of up to fifteen) for this record. Field names and order are defined by the owning series. |
| id | long | The database-assigned unique identifier for this record. |
| periodFrom | Date | The start of the reporting period that this sale occurred in. Most queries and reports for a series filter and order records by this field. |
| periodTo | Date | The end of the reporting period that this sale occurred in. |
| productSku | String | The SKU code of the product this sale relates to, used to look up the matching product SKU record. May be null or blank if the record is not associated with a specific product. |
| rewardsIssuedDate | Date | The date on which reward points were generated for this record, set once processing has allocated points from it. |
| salesBy | BaseEntity | The organisation or user that the sale is attributed to, used for leaderboards, targets and reward point allocation. May be a profile or a suborganisation depending on how the series is configured. |
| salesTeam | Organisation | The sales team organisation that the participant belongs to, if the sale should also be attributed to a team for team-level reporting and rewards. |
| series | SalesDataSeries | The sales data series that this record belongs to. The series defines the field names, frequency and target calculations that this record is measured against. |
| tag1 | String | The free-text value of tag 1 (of up to five) on this record, used for ad-hoc categorisation and search. |
| tag2 | String | The free-text value of tag 2 (of up to five) on this record, used for ad-hoc categorisation and search. |
| tag3 | String | The free-text value of tag 3 (of up to five) on this record, used for ad-hoc categorisation and search. |
| tag4 | String | The free-text value of tag 4 (of up to five) on this record, used for ad-hoc categorisation and search. |
| tag5 | String | The free-text value of tag 5 (of up to five) on this record, used for ad-hoc categorisation and search. |
| tagsList | List<String> | The non-blank tags set on this record, in tag1 to tag5 order. |
Methods
getDateEntered() · getId() · getProductSku() · setProductSku(String productSku) · getCollectorOrg() · setCollectorOrg(Organisation collectorOrg) · getSeries() · setSeries(SalesDataSeries series) · getAmount() · setAmount(BigDecimal amount) · setDateEntered(Date dateEntered) · getPeriodFrom() · setPeriodFrom(Date periodFrom) · getPeriodTo() · setPeriodTo(Date periodTo) · getEnteredBy() · setEnteredBy(Profile enteredBy) · getSalesBy() · setSalesBy(BaseEntity salesBy) · getSalesTeam() · setSalesTeam(Organisation salesTeam) · getRewardsIssuedDate() · setRewardsIssuedDate(Date rewardsIssuedDate) · getField1() · setField1(String field1) · getField2() · setField2(String field2) · getField3() · setField3(String field3) · getField4() · setField4(String field4) · getField5() · setField5(String field5) · getField6() · setField6(String field6) · getField7() · setField7(String field7) · getField8() · setField8(String field8) · getField9() · setField9(String field9) · getField10() · setField10(String s) · getField11() · setField11(String s) · getField12() · setField12(String field12) · getField13() · setField13(String field13) · getField14() · setField14(String field14) · getField15() · setField15(String field15) · getTag1() · setTag1(String tag1) · getTag2() · setTag2(String tag2) · getTag3() · setTag3(String tag3) · getTag4() · setTag4(String tag4) · getTag5() · setTag5(String tag5) · getAuditOrg() · fieldValue(String name) · fieldValue(int i) · setField(String fieldName, String s) · getTagsList() · findProductSku() · findPointsAllocation()
getDateEntered()
Returns: Date
Date and time the record was entered or imported into the system. This is distinct from the reporting period the record covers.
getId()
Returns: long
The database-assigned unique identifier for this record.
getProductSku()
Returns: String
The SKU code of the product this sale relates to, used to look up the matching product SKU record. May be null or blank if the record is not associated with a specific product.
setProductSku(String productSku)
Returns: void
Sets the SKU code of the product this sale relates to.
| Parameter | Description |
|---|---|
productSku | the product SKU code to set |
getCollectorOrg()
Returns: Organisation
The organisation that collected this sales data, which is the same organisation that owns the parent sales data series. Used to scope audit records and access control for this record.
setCollectorOrg(Organisation collectorOrg)
Returns: void
Sets the organisation that collected this sales data.
| Parameter | Description |
|---|---|
collectorOrg | the collecting organisation to set |
getSeries()
Returns: SalesDataSeries
The sales data series that this record belongs to. The series defines the field names, frequency and target calculations that this record is measured against.
setSeries(SalesDataSeries series)
Returns: void
Sets the sales data series that this record belongs to.
| Parameter | Description |
|---|---|
series | the owning sales data series to set |
getAmount()
Returns: BigDecimal
The numeric value recorded for this sale, in the units defined by the owning series (for example a currency amount or a count). This is the value summed, averaged and compared against targets in reporting.
setAmount(BigDecimal amount)
Returns: void
Sets the numeric value recorded for this sale.
| Parameter | Description |
|---|---|
amount | the amount to set |
setDateEntered(Date dateEntered)
Returns: void
Sets the date and time the record was entered or imported.
| Parameter | Description |
|---|---|
dateEntered | the entered date to set |
getPeriodFrom()
Returns: Date
The start of the reporting period that this sale occurred in. Most queries and reports for a series filter and order records by this field.
setPeriodFrom(Date periodFrom)
Returns: void
Sets the start of the reporting period that this sale occurred in.
| Parameter | Description |
|---|---|
periodFrom | the period start date to set |
getPeriodTo()
Returns: Date
The end of the reporting period that this sale occurred in.
setPeriodTo(Date periodTo)
Returns: void
Sets the end of the reporting period that this sale occurred in.
| Parameter | Description |
|---|---|
periodTo | the period end date to set |
getEnteredBy()
Returns: Profile
The profile who entered or imported this record, for audit purposes. This is not necessarily the participant the sale is attributed to.
setEnteredBy(Profile enteredBy)
Returns: void
Sets the profile who entered or imported this record.
| Parameter | Description |
|---|---|
enteredBy | the entering profile to set |
getSalesBy()
Returns: BaseEntity
The organisation or user that the sale is attributed to, used for leaderboards, targets and reward point allocation. May be a profile or a suborganisation depending on how the series is configured.
setSalesBy(BaseEntity salesBy)
Returns: void
Sets the organisation or user that the sale is attributed to.
| Parameter | Description |
|---|---|
salesBy | the entity to attribute the sale to |
getSalesTeam()
Returns: Organisation
The sales team organisation that the participant belongs to, if the sale should also be attributed to a team for team-level reporting and rewards.
setSalesTeam(Organisation salesTeam)
Returns: void
Sets the sales team organisation that the participant belongs to.
| Parameter | Description |
|---|---|
salesTeam | the sales team organisation to set |
getRewardsIssuedDate()
Returns: Date
The date on which reward points were generated for this record, set once processing has allocated points from it.
setRewardsIssuedDate(Date rewardsIssuedDate)
Returns: void
Sets the date on which reward points were generated for this record.
| Parameter | Description |
|---|---|
rewardsIssuedDate | the rewards-issued date to set |
getField1()
Returns: String
The value of custom field 1 (of up to fifteen) for this record. Field names and order are defined by the owning series.
setField1(String field1)
Returns: void
Sets the value of custom field 1 for this record.
| Parameter | Description |
|---|---|
field1 | the value to set |
getField2()
Returns: String
The value of custom field 2 (of up to fifteen) for this record. Field names and order are defined by the owning series.
setField2(String field2)
Returns: void
Sets the value of custom field 2 for this record.
| Parameter | Description |
|---|---|
field2 | the value to set |
getField3()
Returns: String
The value of custom field 3 (of up to fifteen) for this record. Field names and order are defined by the owning series.
setField3(String field3)
Returns: void
Sets the value of custom field 3 for this record.
| Parameter | Description |
|---|---|
field3 | the value to set |
getField4()
Returns: String
The value of custom field 4 (of up to fifteen) for this record. Field names and order are defined by the owning series.
setField4(String field4)
Returns: void
Sets the value of custom field 4 for this record.
| Parameter | Description |
|---|---|
field4 | the value to set |
getField5()
Returns: String
The value of custom field 5 (of up to fifteen) for this record. Field names and order are defined by the owning series.
setField5(String field5)
Returns: void
Sets the value of custom field 5 for this record.
| Parameter | Description |
|---|---|
field5 | the value to set |
getField6()
Returns: String
The value of custom field 6 (of up to fifteen) for this record. Field names and order are defined by the owning series.
setField6(String field6)
Returns: void
Sets the value of custom field 6 for this record.
| Parameter | Description |
|---|---|
field6 | the value to set |
getField7()
Returns: String
The value of custom field 7 (of up to fifteen) for this record. Field names and order are defined by the owning series.
setField7(String field7)
Returns: void
Sets the value of custom field 7 for this record.
| Parameter | Description |
|---|---|
field7 | the value to set |
getField8()
Returns: String
The value of custom field 8 (of up to fifteen) for this record. Field names and order are defined by the owning series.
setField8(String field8)
Returns: void
Sets the value of custom field 8 for this record.
| Parameter | Description |
|---|---|
field8 | the value to set |
getField9()
Returns: String
The value of custom field 9 (of up to fifteen) for this record. Field names and order are defined by the owning series.
setField9(String field9)
Returns: void
Sets the value of custom field 9 for this record.
| Parameter | Description |
|---|---|
field9 | the value to set |
getField10()
Returns: String
The value of custom field 10 (of up to fifteen) for this record. Field names and order are defined by the owning series.
setField10(String s)
Returns: void
Sets the value of custom field 10 for this record.
| Parameter | Description |
|---|---|
s | the value to set |
getField11()
Returns: String
The value of custom field 11 (of up to fifteen) for this record. Field names and order are defined by the owning series.
setField11(String s)
Returns: void
Sets the value of custom field 11 for this record.
| Parameter | Description |
|---|---|
s | the value to set |
getField12()
Returns: String
The value of custom field 12 (of up to fifteen) for this record. Field names and order are defined by the owning series.
setField12(String field12)
Returns: void
Sets the value of custom field 12 for this record.
| Parameter | Description |
|---|---|
field12 | the value to set |
getField13()
Returns: String
The value of custom field 13 (of up to fifteen) for this record. Field names and order are defined by the owning series.
setField13(String field13)
Returns: void
Sets the value of custom field 13 for this record.
| Parameter | Description |
|---|---|
field13 | the value to set |
getField14()
Returns: String
The value of custom field 14 (of up to fifteen) for this record. Field names and order are defined by the owning series.
setField14(String field14)
Returns: void
Sets the value of custom field 14 for this record.
| Parameter | Description |
|---|---|
field14 | the value to set |
getField15()
Returns: String
The value of custom field 15 (of up to fifteen) for this record. Field names and order are defined by the owning series.
setField15(String field15)
Returns: void
Sets the value of custom field 15 for this record.
| Parameter | Description |
|---|---|
field15 | the value to set |
getTag1()
Returns: String
The free-text value of tag 1 (of up to five) on this record, used for ad-hoc categorisation and search.
setTag1(String tag1)
Returns: void
Sets the free-text value of tag 1 on this record.
| Parameter | Description |
|---|---|
tag1 | the value to set |
getTag2()
Returns: String
The free-text value of tag 2 (of up to five) on this record, used for ad-hoc categorisation and search.
setTag2(String tag2)
Returns: void
Sets the free-text value of tag 2 on this record.
| Parameter | Description |
|---|---|
tag2 | the value to set |
getTag3()
Returns: String
The free-text value of tag 3 (of up to five) on this record, used for ad-hoc categorisation and search.
setTag3(String tag3)
Returns: void
Sets the free-text value of tag 3 on this record.
| Parameter | Description |
|---|---|
tag3 | the value to set |
getTag4()
Returns: String
The free-text value of tag 4 (of up to five) on this record, used for ad-hoc categorisation and search.
setTag4(String tag4)
Returns: void
Sets the free-text value of tag 4 on this record.
| Parameter | Description |
|---|---|
tag4 | the value to set |
getTag5()
Returns: String
The free-text value of tag 5 (of up to five) on this record, used for ad-hoc categorisation and search.
setTag5(String tag5)
Returns: void
Sets the free-text value of tag 5 on this record.
| Parameter | Description |
|---|---|
tag5 | the value to set |
getAuditOrg()
Returns: Organisation
The organisation that audit entries for changes to this record are recorded against, which is the collecting organisation.
fieldValue(String name)
Returns: String
Looks up the value of the field on this record whose column corresponds to the named field in the owning series' field definitions.
| Parameter | Description |
|---|---|
name | the field name as defined on the owning series |
fieldValue(int i)
Returns: String
Looks up the value of the field at the given position (1 to 15) on this record.
| Parameter | Description |
|---|---|
i | the 1-based field position to look up |
setField(String fieldName, String s)
Returns: void
Sets the value of the field on this record identified by name or by "fieldN" position, where N is the field's 1-based ordinal. Does nothing if the field name cannot be resolved.
| Parameter | Description |
|---|---|
fieldName | the field name as defined on the owning series, or a literal "fieldN" position such as "field3" |
s | the value to set |
getTagsList()
Returns: List<String>
The non-blank tags set on this record, in tag1 to tag5 order.
findProductSku()
Returns: ProductSku
Looks up the product SKU record matching this record's product SKU code within the owning series' organisation. Performs a database lookup.
findPointsAllocation()
Returns: List<PointsAllocation>
Finds the reward points allocations that have been generated from this record. Performs a database lookup.