SALESORDERITEMSCENARIOSDONE (4.0SP20)

Support table for auto apply discounts - Keeps track of scenarios that have been completed so they are not duplicated.

Primary Key
Primary Key Field Type

ID

uniqueidentifier

Foreign Key Fields
Foreign Key Field Type Null Notes Description

SALESORDERID

uniqueidentifier

false

Foreign key to the SALESORDER table

ADDEDBYID

uniqueidentifier

false

FK to CHANGEAGENT.

CHANGEDBYID

uniqueidentifier

false

FK to CHANGEAGENT.

Fields
Field Field Type Null Notes Description

DISCOUNTSCENARIOID

uniqueidentifier

false

Foreign key to a discount scenario in the SALESORDERITEMDISCOUNTOPTION table.

SALESORDERITEMID

uniqueidentifier

false

Foreign key to a SALESORDERITEM table.

QUANTITY

int

false

0

Number of order items in scenario.

DATEADDED

datetime

false

getdate()

Indicates the date this record was added.

DATECHANGED

datetime

false

getdate()

Indicates the date this record was last changed.

TS

timestamp

false

Timestamp.

TSLONG

bigint (Computed)

true

Numeric representation of the timestamp.

Indexes
Index Name Field(s) Unique Primary Clustered

IX_SALESORDERITEMSCENARIOSDONE_DATEADDED

DATEADDED

False

False

True

IX_SALESORDERITEMSCENARIOSDONE_DATECHANGED

DATECHANGED

False

False

False

IX_SALESORDERITEMSCENARIOSDONE_SALESORDERID

SALESORDERID

False

False

False

PK_SALESORDERITEMSCENARIOSDONE

ID

True

True

False

Triggers
Trigger Name Description

TR_SALESORDERITEMSCENARIOSDONE_AUDIT_UPDATE

TR_SALESORDERITEMSCENARIOSDONE_AUDIT_DELETE