Skip to main content
Whether you’re a sales rep who wants to see whether you have enough ongoing sales opportunities to reach their budget or a sales manager who wants to see how their team is performing, inspecting the pipeline provides valuable info.
You can only retrieve sales for persons that are SuperOffice users associates. The signed-in user must also have permission to view those sales. Otherwise, an exception is thrown.
To view basic info, use NSSale:
To view (and possibly update) complex info, use NSSaleEntity:

NSSale[] GetSalesByDate(DateTime fromDate, DateTime toDate, Integer amountLimit, Integer status)

Fetch all sales within a time period. Optionally limit the result by amount and/or status.
  • amountLimit: amount in local currency OR -1 to ignore filter
  • status: 1-4 (open,sold,lost,stalled) OR 0 to ignore filter

NSSale[] GetOpenSalesForContact(Integer contactId)

NSSale[] GetUpcomingSales(Integer weightedAmountLimit, Integer count)

Fetches all open sales (in descending order). Optionally limit the result by a weighted amount and/or count. Set either filter to -1 top ignore it. Weighting is based on the probability that the sale will be closed (amount * probability).

Statistics

NSSaleSummary GetSummaryByAssociate(Integer associateId, DateTime start, DateTime end)

This example fetches the number of sold, lost, and open sales for an associate since January 01, 2020.

NSSaleSummary GetSummaryByContact(Integer contactId, DateTime start, DateTime end)

This example fetches the number of sales and the total amount for a company from the time it was registered until now.