Class NSSaleAgent
Syntax
Examples
NSSaleAgent agent;
agent.callMethod(arg1, arg2);
Constructors
NSSaleAgent()
Declaration
Examples
NSSaleAgent agent;
agent.callMethod(arg1, arg2);
Methods
AddSaleStakeholders(Integer,NSSaleStakeholder[])
Declaration
Void AddSaleStakeholders(Integer saleId, NSSaleStakeholder[] saleStakeholders)
Parameters
Returns
Examples
NSSaleAgent agent;
agent.callMethod(arg1, arg2);
BatchUpdateNextDueDate()
Re-calculates all the next due dates
Declaration
Void BatchUpdateNextDueDate()
Returns
Examples
NSSaleAgent agent;
agent.callMethod(arg1, arg2);
CreateDefaultSaleEntity()
Sets default values into a new NSSaleEntity.
Declaration
NSSaleEntity CreateDefaultSaleEntity()
Returns
Examples
NSSaleAgent agent;
NSSaleEntity thing = agent.CreateDefaultSaleEntity();
thing = agent.SaveSaleEntity(thing);
CreateDefaultSaleStakeholder()
Sets default values into a new NSSaleStakeholder.
Declaration
NSSaleStakeholder CreateDefaultSaleStakeholder()
Returns
Examples
NSSaleAgent agent;
NSSaleStakeholder thing = agent.CreateDefaultSaleStakeholder();
thing = agent.SaveSaleStakeholder(thing);
CreateDefaultSaleSummary()
Sets default values into a new NSSaleSummary.
Declaration
NSSaleSummary CreateDefaultSaleSummary()
Returns
Examples
NSSaleAgent agent;
NSSaleSummary thing = agent.CreateDefaultSaleSummary();
thing = agent.SaveSaleSummary(thing);
DeleteSaleEntity(Integer)
Declaration
DeleteSaleEntity(Integer saleEntity)
Parameters
Type |
Name |
Description |
Integer |
saleEntity |
|
Returns
Examples
NSSaleAgent agent;
agent.DeleteSaleEntity(123);
DeleteSaleStakeholder(Integer)
Deletes the NSSaleStakeholder
Declaration
DeleteSaleStakeholder(Integer saleStakeholder)
Parameters
Type |
Name |
Description |
Integer |
saleStakeholder |
|
Returns
Examples
NSSaleAgent agent;
agent.DeleteSaleStakeholder(123);
DeleteSaleStakeholders(Integer[])
Declaration
Void DeleteSaleStakeholders(Integer[] saleStakeholderIds)
Parameters
Type |
Name |
Description |
Integer[] |
saleStakeholderIds |
|
Returns
Examples
NSSaleAgent agent;
agent.callMethod(arg1, arg2);
GetMyOpportunities(Integer)
Returns opportunities (open sales) belonging to the user currently logged on
Declaration
NSSale[] GetMyOpportunities(Integer count)
Parameters
Type |
Name |
Description |
Integer |
count |
|
Returns
Examples
NSSaleAgent agent;
Integer count;
NSSale[] res = agent.GetMyOpportunities(count);
GetNextDueDate(Integer)
Gets the next due date for a sale.
Declaration
DateTime GetNextDueDate(Integer saleId)
Parameters
Type |
Name |
Description |
Integer |
saleId |
|
Returns
Examples
NSSaleAgent agent;
Integer saleId;
DateTime res = agent.GetNextDueDate(saleId);
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.
Declaration
Integer GetNextSaleStage(Integer saleId, Bool includeCurrentStage)
Parameters
Type |
Name |
Description |
Integer |
saleId |
|
Bool |
includeCurrentStage |
|
Returns
Examples
NSSaleAgent agent;
agent.callMethod(arg1, arg2);
Returns all open sales for the contact provided.
Declaration
NSSale[] GetOpenSalesForContact(Integer contactId)
Parameters
Type |
Name |
Description |
Integer |
contactId |
|
Returns
NSSaleAgent agent;
Integer contactId;
NSSale[] res = agent.GetOpenSalesForContact(contactId);
GetProbabilityFromStage(Integer)
Gets the probability percentage for a given sale stage
Declaration
Integer GetProbabilityFromStage(Integer stageId)
Parameters
Type |
Name |
Description |
Integer |
stageId |
|
Returns
Examples
NSSaleAgent agent;
Integer stageId;
Integer res = agent.GetProbabilityFromStage(stageId);
GetRecentSales(Integer,Integer)
Returns the latest sales (that are sold) limited by their amount.
Declaration
NSSale[] GetRecentSales(Integer amountLimit, Integer count)
Parameters
Type |
Name |
Description |
Integer |
amountLimit |
If the amount is -1, the amount restriction is omitted.
|
Integer |
count |
|
Returns
Type |
Description |
NSSale[] |
The result is sorted descending with the latest first.
|
Examples
NSSaleAgent agent;
Integer amountLimit;
Integer count;
NSSale[] res = agent.GetRecentSales(amountLimit, count);
GetSale(Integer)
Declaration
NSSale GetSale(Integer saleId)
Parameters
Type |
Name |
Description |
Integer |
saleId |
|
Returns
Examples
NSSaleAgent agent;
NSSale thing = agent.GetSale(123);
GetSaleEntity(Integer)
Gets an NSSaleEntity object.
Declaration
NSSaleEntity GetSaleEntity(Integer saleEntityId)
Parameters
Type |
Name |
Description |
Integer |
saleEntityId |
|
Returns
Examples
NSSaleAgent agent;
NSSaleEntity thing = agent.GetSaleEntity(123);
GetSaleList(Integer[])
Gets an array of Sale objects.
Declaration
NSSale[] GetSaleList(Integer[] saleIds)
Parameters
Type |
Name |
Description |
Integer[] |
saleIds |
|
Returns
Examples
Integer[] ids;
NSSaleAgent agent;
agent.GetSaleList(ids);
GetSalesByDate(DateTime,DateTime,Integer,Integer)
Returns all sales within a time period. The sales array can be limited by amount and status.
Declaration
NSSale[] GetSalesByDate(DateTime fromDate, DateTime toDate, Integer amountLimit, Integer status)
Parameters
Returns
Examples
NSSaleAgent agent;
DateTime fromDate;
DateTime toDate;
Integer amountLimit;
Integer status;
NSSale[] res = agent.GetSalesByDate(fromDate, toDate, amountLimit, status);
Returns all sales for the contact provided.
Declaration
NSSale[] GetSalesFromContact(Integer contactId, Bool onlyOpenSales)
Parameters
Type |
Name |
Description |
Integer |
contactId |
|
Bool |
onlyOpenSales |
|
Returns
NSSaleAgent agent;
Integer contactId;
Bool onlyOpenSales;
NSSale[] res = agent.GetSalesFromContact(contactId, onlyOpenSales);
GetSalesFromPerson(Integer,Bool)
Returns all sales for the person provided.
Declaration
NSSale[] GetSalesFromPerson(Integer personId, Bool onlyOpenSales)
Parameters
Type |
Name |
Description |
Integer |
personId |
|
Bool |
onlyOpenSales |
|
Returns
Examples
NSSaleAgent agent;
Integer personId;
Bool onlyOpenSales;
NSSale[] res = agent.GetSalesFromPerson(personId, onlyOpenSales);
GetSaleStakeholder(Integer)
Gets an NSSaleStakeholder object.
Declaration
NSSaleStakeholder GetSaleStakeholder(Integer saleStakeholderId)
Parameters
Type |
Name |
Description |
Integer |
saleStakeholderId |
|
Returns
Examples
NSSaleAgent agent;
NSSaleStakeholder thing = agent.GetSaleStakeholder(123);
GetSaleStakeholderById(Integer[])
Declaration
NSSaleStakeholder[] GetSaleStakeholderById(Integer[] saleStakeholderIds)
Parameters
Type |
Name |
Description |
Integer[] |
saleStakeholderIds |
|
Returns
Examples
NSSaleAgent agent;
agent.callMethod(arg1, arg2);
GetSaleStakeholderList(Integer[])
Gets an array of SaleStakeholder objects.
Declaration
NSSaleStakeholder[] GetSaleStakeholderList(Integer[] saleStakeholderIds)
Parameters
Type |
Name |
Description |
Integer[] |
saleStakeholderIds |
|
Returns
Examples
Integer[] ids;
NSSaleAgent agent;
agent.GetSaleStakeholderList(ids);
GetSaleStakeholders(Integer)
Declaration
NSSaleStakeholder[] GetSaleStakeholders(Integer saleId)
Parameters
Type |
Name |
Description |
Integer |
saleId |
|
Returns
Examples
NSSaleAgent agent;
agent.callMethod(arg1, arg2);
GetSummaryByAssociate(Integer,DateTime,DateTime)
Declaration
NSSaleSummary GetSummaryByAssociate(Integer associateId, DateTime fromDate, DateTime toDate)
Parameters
Returns
Examples
NSSaleAgent agent;
agent.callMethod(arg1, arg2);
Declaration
NSSaleSummary GetSummaryByContact(Integer contactId, DateTime fromDate, DateTime toDate)
Parameters
Returns
NSSaleAgent agent;
agent.callMethod(arg1, arg2);
GetSummaryByGroup(Integer,DateTime,DateTime)
Declaration
NSSaleSummary GetSummaryByGroup(Integer groupId, DateTime fromDate, DateTime toDate)
Parameters
Returns
Examples
NSSaleAgent agent;
agent.callMethod(arg1, arg2);
GetUpcomingSales(Integer,Integer)
Returns all open sales, sorted descending with the latest first.
Declaration
NSSale[] GetUpcomingSales(Integer weightedAmountLimit, Integer count)
Parameters
Type |
Name |
Description |
Integer |
weightedAmountLimit |
If the weighted amount is -1, the amount restriction is omitted.
|
Integer |
count |
|
Returns
Examples
NSSaleAgent agent;
Integer weightedAmountLimit;
Integer count;
NSSale[] res = agent.GetUpcomingSales(weightedAmountLimit, count);
HasGuide(Integer)
Does this sale have a sale guide associated with its sale type?
Declaration
Bool HasGuide(Integer saleId)
Parameters
Type |
Name |
Description |
Integer |
saleId |
|
Returns
Examples
NSSaleAgent agent;
Integer saleId;
Bool res = agent.HasGuide(saleId);
HasGuideActivities(Integer)
Declaration
Bool HasGuideActivities(Integer saleId)
Parameters
Type |
Name |
Description |
Integer |
saleId |
|
Returns
Examples
NSSaleAgent agent;
agent.callMethod(arg1, arg2);
HasStakeholderSetting(Integer)
Declaration
Bool HasStakeholderSetting(Integer saleId)
Parameters
Type |
Name |
Description |
Integer |
saleId |
|
Returns
Examples
NSSaleAgent agent;
agent.callMethod(arg1, arg2);
IsNumberValid(Integer,String)
Checks if the number is unique or required.
Declaration
Bool IsNumberValid(Integer contactId, String number)
Parameters
Returns
Examples
NSSaleAgent agent;
Integer contactId;
String number;
Bool res = agent.IsNumberValid(contactId, number);
OfferAutoNextStageOnApppointmentCompleted(Integer)
Declaration
Bool OfferAutoNextStageOnApppointmentCompleted(Integer appointmentId)
Parameters
Type |
Name |
Description |
Integer |
appointmentId |
|
Returns
Examples
NSSaleAgent agent;
agent.callMethod(arg1, arg2);
SaveSaleEntity(NSSaleEntity)
Updates the existing NSSaleEntity or creates a new NSSaleEntity if the ID parameter is 0.
Declaration
NSSaleEntity SaveSaleEntity(NSSaleEntity saleEntity)
Parameters
Returns
Type |
Description |
NSSaleEntity |
The new or updated NSSaleEntity.
|
Examples
NSSale agent;
NSSaleEntity thing = agent.CreateDefaultSaleEntity();
thing = agent.SaveSaleEntity(thing);
SaveSaleStakeholder(NSSaleStakeholder)
Updates the existing NSSaleStakeholder or creates a new NSSaleStakeholder if the id parameter is 0
Declaration
NSSaleStakeholder SaveSaleStakeholder(NSSaleStakeholder saleStakeholder)
Parameters
Type |
Name |
Description |
NSSaleStakeholder |
saleStakeholder |
The NSSaleStakeholder to save.
|
Returns
Examples
NSSale agent;
NSSaleStakeholder thing = agent.CreateDefaultSaleStakeholder();
thing = agent.SaveSaleStakeholder(thing);
SetAsLost(Integer[])
Changes the status of one or more sales to Lost.
Declaration
Void SetAsLost(Integer[] saleIds)
Parameters
Type |
Name |
Description |
Integer[] |
saleIds |
|
Returns
Examples
NSSaleAgent agent;
agent.callMethod(arg1, arg2);
SetAsSold(Integer[])
Changes the status of one or more Sales to Sold.
Declaration
Void SetAsSold(Integer[] saleIds)
Parameters
Type |
Name |
Description |
Integer[] |
saleIds |
|
Returns
Examples
NSSaleAgent agent;
agent.callMethod(arg1, arg2);
UpdateSaleStakeholders(NSSaleStakeholder[])
Declaration
NSSaleStakeholder[] UpdateSaleStakeholders(NSSaleStakeholder[] stakeholders)
Parameters
Returns
Examples
NSSaleAgent agent;
agent.callMethod(arg1, arg2);
ValidateSaleEntity(NSSaleEntity)
Checks that entity is ready for saving, return error messages by field.
Declaration
Map ValidateSaleEntity(NSSaleEntity saleEntity)
Parameters
Returns
Examples
NSSaleAgent agent;
NSSaleEntity saleEntity;
Map res = agent.ValidateSaleEntity(saleEntity);