Project guides

Stages

NSSelectableMDOListItem[] GetStages()

NSListAgent listAgent;

NSProjectTypeEntity type = listAgent.GetProjectTypeEntity(2);

NSSelectableMDOListItem[] stages = type.GetStages();

foreach (NSSelectableMDOListItem s in stages) {
  printLine(s.GetId().toString() + " | " + s.GetName() + "\t Rank " + s.GetRank().toString());
}
๐Ÿ›ˆ Note
The ID and rank of a stage are not necessarily identical!

Bool GetIsAutoAdvance()

NSListAgent listAgent;

NSProjectTypeEntity type = listAgent.GetProjectTypeEntity(2);

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

Suggested activities

List available suggestions

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

Create follow-up from suggestion

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

  • ID of the suggested follow-up (appointment)
  • ID of the project
  • ID of the owner (associate)
NSAppointmentAgent appointmentAgent;
NSAppointmentEntity newAppointment = appointmentAgent.CreateDefaultAppointmentEntityFromProjectSuggestion(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 project charter with a duration of 2 hours. It then links it to an NSProjectTypeStatusLink with ID 1.

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

myBlueprint.SetName("Read project charter");

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

NSProjectTypeStatusLink link;
link.SetProjStatusId(1);
link.SetProjTypeId(1);
link.SetProjectTypeStatusLinkId(1);
myBlueprint.SetProjectTypeStatusLink(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
ProjectTypeStatusLink_idID
projType_idLink to type
projStatus_idLink to status
ranksort order

SuggestedAppointment

FieldDescription
SuggestedAppointment_idID
namename of blueprint shown in guide
ranksort order
projectTypeStatusLinkIdanchor for project guide items
task_idtype of the suggested follow-up
daysFuturewhen the follow-up should be scheduled
durationin minutes
textThe suggested text of the new follow-up

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

SuggestedDocument

FieldDescription
SuggestedDocument_idID
namename of blueprint shown in guide
ranksort order
projectTypeStatusLinkIdanchor for sale guide items
doctmpl_idtype of the suggested document

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