> ## Documentation Index
> Fetch the complete documentation index at: https://docs.superoffice.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Project guides

> How to work with project guides in CRMScript.

## Stages

### NSSelectableMDOListItem\[] GetStages()

```crmscript! theme={null}
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!
</Note>

### Bool GetIsAutoAdvance()

```crmscript! theme={null}
NSListAgent listAgent;

NSProjectTypeEntity type = listAgent.GetProjectTypeEntity(2);

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

## Suggested activities

### List available suggestions

```crmscript! theme={null}
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)

```crmscript theme={null}
NSAppointmentAgent appointmentAgent;
NSAppointmentEntity newAppointment = appointmentAgent.CreateDefaultAppointmentEntityFromProjectSuggestion(3,4,false,5);
newAppointment = appointmentAgent.SaveAppointmentEntity(newAppointment);
```

<Tip>
  You can also [create documents from suggestions][3].
</Tip>

### Create a suggestion and link it to a stage

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.

```crmscript! theme={null}
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.
</Tip>

## Reference

### ProjectTypeStatusLink

| Field                     | Description    |
| :------------------------ | :------------- |
| ProjectTypeStatusLink\_id | ID             |
| projType\_id              | Link to  type  |
| projStatus\_id            | Link to status |
| rank                      | sort order     |

### SuggestedAppointment

| Field                    | Description                             |
| :----------------------- | :-------------------------------------- |
| SuggestedAppointment\_id | ID                                      |
| name                     | name of blueprint shown in guide        |
| rank                     | sort order                              |
| projectTypeStatusLinkId  | anchor for project guide items          |
| task\_id                 | type of the suggested follow-up         |
| daysFuture               | when the follow-up should be scheduled  |
| duration                 | in minutes                              |
| text                     | The suggested text of the new follow-up |

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

### SuggestedDocument

| Field                   | Description                      |
| :---------------------- | :------------------------------- |
| SuggestedDocument\_id   | ID                               |
| name                    | name of blueprint shown in guide |
| rank                    | sort order                       |
| projectTypeStatusLinkId | anchor for sale guide items      |
| doctmpl\_id             | type of the suggested document   |

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

[3]: ../document/properties

[5]: ../../../../database/tables/suggestedappointment

[6]: ../../../../database/tables/suggesteddocument


## Related topics

- [Projects](/en/project/dev/index.md)
- [Project guides](/en/project/learn/project-guides.md)
- [Project](/en/project/learn/index.md)
- [Merge projects](/en/project/learn/merge-projects.md)
- [Project type](/en/project/admin/project-type.md)
