Guides

๐Ÿ›ˆ Note
This feature requires a Sales Premium license. For details, see the list of user plans.

Stages

NSSelectableMDOListItem[] GetStages()

NSListAgent listAgent;
NSSaleTypeEntity type = listAgent.GetSaleTypeEntity(1);
NSSelectableMDOListItem[] stages = type.GetStages();

for(Integer i = 0; i < stages.length(); i++) {
  printLine(stages[i].GetId().toString() + " | " + stages[i].GetName() + "\t Rank " + stages[i].GetRank().toString());
}
๐Ÿ›ˆ Note
The ID and rank of a stage are not necessarily identical!

Get stages without using the sale type

NSMDOAgent a;

NSMDOListItem[] saleprob = a.GetList("saleprobability",false,"",false);

for(Integer i = 0; i < saleprob.length(); i++) {
  printLine(saleprob[i].GetId().toString() + "\t" + saleprob[i].GetName());
}

Bool GetIsAutoAdvance()

NSListAgent listAgent;
NSSaleTypeEntity type = listAgent.GetSaleTypeEntity(1);

printLine("This sale will auto advance: " + type.GetIsAutoAdvance().toString());

Suggested activities

List available suggestions

SearchEngine se;
se.addFields("SuggestedAppointment", "SuggestedAppointment_id,name,saleTypeStageLinkId");
print(se.executeTextTable());

Create follow-up from suggestion

All you need is 3 IDs, and then calling CreateDefaultAppointmentEntityFromSaleSuggestion() will do the magic for you!

  • ID of the suggested appointment
  • ID of the sale
  • ID of the owner (associate)
NSAppointmentAgent appointmentAgent;
NSAppointmentEntity newAppointment = appointmentAgent.CreateDefaultAppointmentEntityFromSaleSuggestion(3,4,false,5);
newAppointment = appointmentAgent.SaveAppointmentEntity(newAppointment);
๐Ÿ›ˆ Tip

You can also create your own blueprints and load default values into them.

This example creates a suggestion called Read specification with a duration of 2 hours. It then links it to an NSSaleTypeStageLink with ID 1.

NSAppointmentAgent appointmentAgent;
NSSuggestedAppointmentEntity myBlueprint = appointmentAgent.CreateDefaultSuggestedAppointmentEntity();

myBlueprint.SetName("Read specification");

TimeSpan t;
t.set(0, 0, 2, 0, 0);
myBlueprint.SetDuration(t);

NSSaleTypeStageLink link;
link.SetProbId(1);
link.SetSaleTypeId(1);
link.SetSaleTypeStageLinkId(1);
myBlueprint.SetSaleTypeStageLink(link);

myBlueprint = appointmentAgent.SaveSuggestedAppointmentEntity(myBlueprint);
๐Ÿ›ˆ Tip
If you re-run the query for SuggestedAppointment, youโ€™ll find the new blueprint and its ID in the result.

Reference

FieldDescription
SaleTypeStageLink_idID
saleType_idLink to sale type
stageIdLink to stage
ranksort order

SuggestedAppointment

FieldDescription
SuggestedAppointment_idID
namename of blueprint shown in guide
ranksort order
saleTypeStageLinkIdanchor for sale guide items
task_idtype of the suggested appointment
daysFuturewhen the appointment should be scheduled
durationin minutes
textThe suggested text of the new appointment

For a complete list of fields, see the database reference.