Skip to main content
The Sale Entity contains the sale amount, currency, and sale members. Sales are linked to contacts, persons, and/or projects.

Constructors

NSSaleEntity()

Initializes a new instance of the NSSaleEntity class.

Methods

Returns: CRMScript.Global.Integer - The number of active ERP links. Example:
Returns: CRMScript.Global.Integer - Number of active links to sale, document, appointment. Example:

GetAmount()

Returns: CRMScript.Global.Float - Total sale amount. Example:

GetAppointment()

Returns: CRMScript.NetServer.NSAppointment Example:

GetAssociate()

Returns: CRMScript.NetServer.NSAssociate - The sale owner. Example:

GetCompetitor()

Returns: CRMScript.NetServer.NSCompetitor - List of all possible competitors. Example:

GetCompleted()

Returns: CRMScript.Global.Integer - The Sale completed state.
The completed state is either Started or Completed. NotStarted is treated as Started. The value maps to the Done database field.
Example:

GetContact()

Returns: CRMScript.NetServer.NSContact - The contact associated with the sale. It may also be 0 if no contact is associated with the sale. Example:

GetCreatedBy()

Returns: CRMScript.NetServer.NSAssociate - Who created to sale. Example:

GetCreatedDate()

Returns: CRMScript.Global.DateTime - Registered date. Example:

GetCredited()

Returns: CRMScript.NetServer.NSCredited - List of who is to be credited for the sale. Example:

GetCurrency()

Returns: CRMScript.NetServer.NSCurrency - The currency the sale object was sold in. Example:

GetCustomFields()

Gets the user-defined + extra fields on a SaleEntity as a map.
Returns: CRMScript.Native.Map Example:

GetEarning()

Returns: CRMScript.Global.Float - Earning on sale. Example:

GetEarningPercent()

Returns: CRMScript.Global.Float - Earning as percent of total. Example:

GetExtraFields()

Gets the extra fields on SaleEntity as a map.
Returns: CRMScript.Native.Map Example:

GetHeading()

Returns: CRMScript.Global.String - Sale heading (short description?). Example:

GetIsPublished()

Returns: CRMScript.Global.Bool - Should this SaleEntity be published and visible to strangers?
Returns: CRMScript.NetServer.NSLink[] - List of all elements linked to the sale. Example:

GetNextDueDate()

Returns: CRMScript.Global.DateTime - Next due date, this is a de.normalization of ‘closest future activity date, or most recent if no future activities’.
Maintained by the system, but very convenient for searching.
Example:

GetNumber()

Returns: CRMScript.Global.String - Alphanumeric user field. Example:

GetPerson()

A sale may also be connected to a person. This must be a contact person registered on the current contact. This does not mean that a person is required.
Returns: CRMScript.NetServer.NSPerson Example:

GetPostit()

Returns: CRMScript.Global.String - The actual text, max 2047 significant characters even though it is stored as a larger data type on some databases. Example:

GetProbability()

Returns: CRMScript.Global.Integer - Actual probability, may differ from the one in the list. Example:

GetProject()

A sale may also be connected to a project, so you see the sale both on the company card, and on the project card. This does not mean that a project is required.
Returns: CRMScript.NetServer.NSProject Example:

GetPublishEventDate()

Returns: CRMScript.Global.DateTime - Publish event date on SaleEntity.

GetPublishFrom()

Returns: CRMScript.Global.DateTime - Publish from date on SaleEntity.

GetPublishTo()

Returns: CRMScript.Global.DateTime - Publish to date on SaleEntity. After this date the event is no longer visible.

GetRating()

Returns: CRMScript.NetServer.NSRating - The sale rating. Example:

GetReason()

Returns: CRMScript.NetServer.NSReason - The sale reason. Example:

GetReasonSold()

Returns: CRMScript.NetServer.NSReasonSold Example:

GetReasonStalled()

Returns: CRMScript.NetServer.NSReasonStalled Example:

GetReopenDate()

Returns: CRMScript.Global.DateTime - Date the sale is to be reopened; valid only for status=stalled. Not necessarily the same as the nextDueDate. Example:

GetSaledate()

Returns: CRMScript.Global.DateTime - (expected / lost / won) sales date. Example:

GetSaleId()

Returns: CRMScript.Global.Integer - Primary key. Example:

GetSaleStakeholders()

Returns: CRMScript.NetServer.NSSaleStakeholder[] Example:

GetSaleText()

Returns: CRMScript.Global.String - Text describing the sale. Example:

GetSaleType()

Returns: CRMScript.NetServer.NSSaleType Example:

GetSource()

Returns: CRMScript.NetServer.NSSource - The sale source. Example:

GetStatus()

Returns: CRMScript.Global.Integer - The state of the Sale (Open, Sold, Lost, Stalled). See <xref href=“CRMScript.NetServer.SaleStatus” data-throw-if-not-resolved=“false”></xref>. Example:

GetUpdatedBy()

Returns: CRMScript.NetServer.NSAssociate - Who updated the sale. Example:

GetUpdatedDate()

Returns: CRMScript.Global.DateTime - Last updated. Example:

GetUserDefinedFields()

Gets the user-defined fields on the SaleEntity as a map.
Returns: CRMScript.Native.Map Example:

GetVisibleFor()

Returns the user groups and/or users the SaleEntity item is visible for.
Returns: CRMScript.NetServer.NSVisibleFor[] Example:
Returns: CRMScript.Global.Void Example:
Returns: CRMScript.Global.Void Example:

SetAmount(Float)

Returns: CRMScript.Global.Void Example:

SetAppointment(NSAppointment)

Returns: CRMScript.Global.Void Example:

SetAssociate(NSAssociate)

Returns: CRMScript.Global.Void Example:

SetCompetitor(NSCompetitor)

Returns: CRMScript.Global.Void Example:

SetCompleted(Integer)

Returns: CRMScript.Global.Void
The completed state is either Started or Completed. NotStarted is treated as Started. The value maps to the Done database field.
Example:

SetContact(NSContact)

Returns: CRMScript.Global.Void Example:

SetCreatedBy(NSAssociate)

Returns: CRMScript.Global.Void Example:

SetCreatedDate(DateTime)

Registered date
Returns: CRMScript.Global.Void Example:

SetCredited(NSCredited)

Returns: CRMScript.Global.Void Example:

SetCurrency(NSCurrency)

Returns: CRMScript.Global.Void Example:

SetCustomFields(Map)

Sets the user-defined and extra fields on a SaleEntity with a map.
Returns: CRMScript.Global.Void Example:

SetEarning(Float)

Returns: CRMScript.Global.Void Example:

SetEarningPercent(Float)

Returns: CRMScript.Global.Void Example:

SetExtraFields(Map)

Sets the extra field values on SaleEntity with a map.
Returns: CRMScript.Global.Void Example:

SetHeading(String)

Returns: CRMScript.Global.Void Example:

SetIsPublished(Bool)

Sets the visibility of the entity
Returns: CRMScript.Global.Void
Returns: CRMScript.Global.Void Example:

SetNextDueDate(DateTime)

Maintained by the system, but very convenient for searching.
Returns: CRMScript.Global.Void Example:

SetNumber(String)

Returns: CRMScript.Global.Void Example:

SetPerson(NSPerson)

A sale may also be connected to a person. This must be a contact person registered on the current contact. This does not mean that a person is required.
Returns: CRMScript.Global.Void Example:

SetPostit(String)

Returns: CRMScript.Global.Void Example:

SetProbability(Integer)

Returns: CRMScript.Global.Void Example:

SetProject(NSProject)

A sale may also be connected to a project, so you see the sale both on the company card, and on the project card. This does not mean that a project is required.
Returns: CRMScript.Global.Void Example:

SetPublishEventDate(DateTime)

Returns: CRMScript.Global.Void

SetPublishFrom(DateTime)

Sets the publish from date on a SaleEntity.
Returns: CRMScript.Global.Void

SetPublishTo(DateTime)

Sets the publish to date on SaleEntity.
Returns: CRMScript.Global.Void

SetRating(NSRating)

Returns: CRMScript.Global.Void Example:

SetReason(NSReason)

Returns: CRMScript.Global.Void Example:

SetReasonSold(NSReasonSold)

Returns: CRMScript.Global.Void Example:

SetReasonStalled(NSReasonStalled)

Returns: CRMScript.Global.Void Example:

SetReopenDate(DateTime)

Returns: CRMScript.Global.Void Example:

SetSaledate(DateTime)

Returns: CRMScript.Global.Void Example:

SetSaleId(Integer)

Returns: CRMScript.Global.Void Example:

SetSaleStakeholders(NSSaleStakeholder[])

Returns: CRMScript.Global.Void Example:

SetSaleText(String)

Returns: CRMScript.Global.Void Example:

SetSaleType(NSSaleType)

Returns: CRMScript.Global.Void Example:

SetSource(NSSource)

Returns: CRMScript.Global.Void Example:

SetStatus(Integer)

Returns: CRMScript.Global.Void Example:

SetUpdatedBy(NSAssociate)

Returns: CRMScript.Global.Void Example:

SetUpdatedDate(DateTime)

Returns: CRMScript.Global.Void Example:

SetUserDefinedFields(Map)

Sets the user-defined fields on the SaleEntity as a map.
Returns: CRMScript.Global.Void Example:

SetVisibleFor(NSVisibleFor[])

Sets the user groups and/or users the SaleEntity item is visible for.
Returns: CRMScript.Global.Void Example: