Skip to main content
Sale data services.

Constructors

NSSaleAgent()

Sale data services.

Methods

AddSaleStakeholders(Integer,NSSaleStakeholder[])

Returns: CRMScript.Global.Void

BatchUpdateNextDueDate()

Re-calculates all the next due dates
Returns: CRMScript.Global.Void

CreateDefaultSaleEntity()

Sets default values into a new NSSaleEntity.
Returns: CRMScript.NetServer.NSSaleEntity
NetServer calculates default values (for example, Country) on the entity, which is required when creating/storing a new instance
Example:

CreateDefaultSaleStakeholder()

Sets default values into a new NSSaleStakeholder.
Returns: CRMScript.NetServer.NSSaleStakeholder
NetServer calculates default values (for example, Country) on the entity, which is required when creating/storing a new instance
Example:

CreateDefaultSaleSummary()

Sets default values into a new NSSaleSummary.
Returns: CRMScript.NetServer.NSSaleSummary
NetServer calculates default values (for example, Country) on the entity, which is required when creating/storing a new instance
Example:

DeleteSaleEntity(Integer)

Deletes the NSSaleEntity
Returns: CRMScript.Global.Void Example:

DeleteSaleStakeholder(Integer)

Deletes the NSSaleStakeholder
Returns: CRMScript.Global.Void Example:

DeleteSaleStakeholders(Integer[])

Returns: CRMScript.Global.Void

GetMyOpportunities(Integer)

Returns opportunities (open sales) belonging to the user currently logged on
Returns: CRMScript.NetServer.NSSale[] Example:

GetNextDueDate(Integer)

Gets the next due date for a sale.
Returns: CRMScript.Global.DateTime
The next due date is the next future appointment that is not completed.
Example:

GetNextSaleStage(Integer,Bool)

Gets the next (not deleted) sale stage ID if the current stage is deleted. If the current stage is not deleted, the CurrentStageId is returned.
Returns: CRMScript.Global.Integer

GetOpenSalesForContact(Integer)

Returns all open sales for the contact provided.
Returns: CRMScript.NetServer.NSSale[] Example:

GetProbabilityFromStage(Integer)

Gets the probability percentage for a given sale stage
Returns: CRMScript.Global.Integer Example:

GetRecentSales(Integer,Integer)

Returns the latest sales (that are sold) limited by their amount.
Returns: CRMScript.NetServer.NSSale[] - The result is sorted descending with the latest first. Example:

GetSale(Integer)

Gets an NSSale object.
Returns: CRMScript.NetServer.NSSale Example:

GetSaleEntity(Integer)

Gets an NSSaleEntity object.
Returns: CRMScript.NetServer.NSSaleEntity Example:

GetSaleList(Integer[])

Gets an array of Sale objects.
Returns: CRMScript.NetServer.NSSale[] Example:

GetSalesByDate(DateTime,DateTime,Integer,Integer)

Returns all sales within a time period. The sales array can be limited by amount and status.
Returns: CRMScript.NetServer.NSSale[] Example:

GetSalesFromContact(Integer,Bool)

Returns all sales for the contact provided.
Returns: CRMScript.NetServer.NSSale[] Example:

GetSalesFromPerson(Integer,Bool)

Returns all sales for the person provided.
Returns: CRMScript.NetServer.NSSale[] Example:

GetSaleStakeholder(Integer)

Gets an NSSaleStakeholder object.
Returns: CRMScript.NetServer.NSSaleStakeholder Example:

GetSaleStakeholderById(Integer[])

Returns: CRMScript.NetServer.NSSaleStakeholder[]

GetSaleStakeholderList(Integer[])

Gets an array of SaleStakeholder objects.
Returns: CRMScript.NetServer.NSSaleStakeholder[] Example:

GetSaleStakeholders(Integer)

Returns: CRMScript.NetServer.NSSaleStakeholder[]

GetSummaryByAssociate(Integer,DateTime,DateTime)

Returns: CRMScript.NetServer.NSSaleSummary

GetSummaryByContact(Integer,DateTime,DateTime)

Returns: CRMScript.NetServer.NSSaleSummary

GetSummaryByGroup(Integer,DateTime,DateTime)

Returns: CRMScript.NetServer.NSSaleSummary

GetUpcomingSales(Integer,Integer)

Returns all open sales, sorted descending with the latest first.
Returns: CRMScript.NetServer.NSSale[] Example:

HasGuide(Integer)

Does this sale have a sale guide associated with its sale type?
Returns: CRMScript.Global.Bool Example:

HasGuideActivities(Integer)

Returns: CRMScript.Global.Bool

HasStakeholderSetting(Integer)

Returns: CRMScript.Global.Bool

IsNumberValid(Integer,String)

Checks if the number is unique or required.
Returns: CRMScript.Global.Bool
The setting is configured from admin under system options.
Example:

OfferAutoNextStageOnApppointmentCompleted(Integer)

Returns: CRMScript.Global.Bool

SaveSaleEntity(NSSaleEntity)

Updates the existing NSSaleEntity or creates a new NSSaleEntity if the ID parameter is 0.
Returns: CRMScript.NetServer.NSSaleEntity - The new or updated NSSaleEntity. Example:

SaveSaleStakeholder(NSSaleStakeholder)

Updates the existing NSSaleStakeholder or creates a new NSSaleStakeholder if the id parameter is 0
Returns: CRMScript.NetServer.NSSaleStakeholder Example:

SetAsLost(Integer[])

Changes the status of one or more sales to Lost.
Returns: CRMScript.Global.Void
This does not affect the Completed state of the sale.

SetAsSold(Integer[])

Changes the status of one or more Sales to Sold.
Returns: CRMScript.Global.Void
This does not mark them as Completed.

UpdateSaleStakeholders(NSSaleStakeholder[])

Returns: CRMScript.NetServer.NSSaleStakeholder[]

ValidateSaleEntity(NSSaleEntity)

Checks that entity is ready for saving, return error messages by field.
Returns: CRMScript.Native.Map Example: