OPPORTUNITY

Stores opportunity information for a plan.

Primary Key

Primary Key Field Type
ID uniqueidentifier

Fields

Field Field Type Null Notes Description
EXPECTEDASKAMOUNT money Default = 0
ASKAMOUNT money Default = 0
EXPECTEDASKDATE datetime yes
ASKDATE datetime yes
RESPONSEDATE datetime yes
STATUSCODE tinyint Default = 0 0=Unqualified, 1=Qualified, 2=Response pending, 3=Accepted, 4=Rejected, 5=Canceled
COMMENT nvarchar(max) Default = ''
DATEADDED datetime Default = getdate() Indicates the date this record was added.
DATECHANGED datetime Default = getdate() Indicates the date this record was last changed.
TS timestamp Timestamp.
TSLONG bigint (Computed) yes CONVERT(bigint, TS) Numeric representation of the timestamp.
STATUS nvarchar(16) (Computed) yes CASE [STATUSCODE] WHEN 0 THEN N'Unqualified' WHEN 1 THEN N'Qualified' WHEN 2 THEN N'Response pending' WHEN 3 THEN N'Accepted' WHEN 4 THEN N'Rejected' WHEN 5 THEN N'Canceled' END Provides a translation for the 'STATUSCODE' field.
ORGANIZATIONEXPECTEDASKAMOUNT money Default = 0 EXPECTEDASKAMOUNT in organization currency.
ORGANIZATIONASKAMOUNT money Default = 0 ASKAMOUNT in organization currency.
TRANSACTIONEXPECTEDASKAMOUNT money Default = 0 EXPECTEDASKAMOUNT in transaction currency.
TRANSACTIONASKAMOUNT money Default = 0 ASKAMOUNT in transaction currency.
ACCEPTEDASKAMOUNT money Default = 0
TRANSACTIONACCEPTEDASKAMOUNT money Default = 0
ORGANIZATIONACCEPTEDASKAMOUNT money Default = 0
AMOUNT money (Computed) yes dbo.UFN_OPPORTUNITY_AMOUNT(ID)
TRANSACTIONAMOUNT money (Computed) yes dbo.UFN_OPPORTUNITY_TRANSACTIONAMOUNT(ID)
ORGANIZATIONAMOUNT money (Computed) yes dbo.UFN_OPPORTUNITY_AMOUNTINCURRENCY(ID, null)

Foreign Keys

Foreign Key Field Type Null Notes Description
PROSPECTPLANID uniqueidentifier PROSPECTPLAN.ID FK to PROSPECTPLAN
ADDEDBYID uniqueidentifier CHANGEAGENT.ID FK to CHANGEAGENT.
CHANGEDBYID uniqueidentifier CHANGEAGENT.ID FK to CHANGEAGENT.
LIKELIHOODTYPECODEID uniqueidentifier yes LIKELIHOODTYPECODE.ID FK to LIKELIHOODTYPECODE
OPPORTUNITYTYPECODEID uniqueidentifier yes OPPORTUNITYTYPECODE.ID FK to OPPORTUNITYTYPECODE
BASECURRENCYID uniqueidentifier yes CURRENCY.ID The base currency associated with this opportunity (always the same as the base currency on the prospect plan to which this opportunity belongs).
TRANSACTIONCURRENCYID uniqueidentifier yes CURRENCY.ID The transaction currency associated with this opportunity.
BASEEXCHANGERATEID uniqueidentifier yes CURRENCYEXCHANGERATE.ID FK to CURRENCYEXCHANGERATE
ORGANIZATIONEXCHANGERATEID uniqueidentifier yes CURRENCYEXCHANGERATE.ID FK to CURRENCYEXCHANGERATE

Indexes

Index Name Fields Unique Primary Clustered
IX_OPPORTUNITY_DATEADDED DATEADDED yes
IX_OPPORTUNITY_DATECHANGED DATECHANGED
IX_OPPORTUNITY_PROSPECTPLANID PROSPECTPLANID
PK_OPPORTUNITY ID yes yes

Triggers

Trigger Name Description
TR_OPPORTUNITY_TASYNC_I
TR_OPPORTUNITY_TASYNC_U
TR_OPPORTUNITY_TASYNC_D
TR_OPPORTUNITY_AUDIT_UPDATE
TR_OPPORTUNITY_AUDIT_DELETE
TR_OPPORTUNITY_AUDIT_ETLDELETEDID
TR_OPPORTUNITY_INSERTUPDATE_CURRENCY

Referenced by

Referenced by Field
BATCHEVENTREGISTRANT OPPORTUNITYID
BATCHMEMBERSHIPDUES DONATIONOPPORTUNITYID
BATCHREVENUE OPPORTUNITYID
BATCHREVENUEADDITIONALAPPLICATIONS OPPORTUNITYID
BATCHREVENUEAPPLICATIONPLEDGE OPPORTUNITYID
BATCHREVENUEENHANCEDMATCHINGGIFTS OPPORTUNITYID
EVENTREGISTRATIONOPPORTUNITY OPPORTUNITYID
NAMINGOPPORTUNITYMGOPPORTUNITY OPPORTUNITYID
OPPORTUNITYCAMPAIGN OPPORTUNITYID
OPPORTUNITYDESIGNATION OPPORTUNITYID
OPPORTUNITYFUNDINGTYPE OPPORTUNITYID
OPPORTUNITYSOLICITOR OPPORTUNITYID
REVENUEOPPORTUNITY OPPORTUNITYID