> ## 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.

# Update project

> How to update, end, and delete a project with CRMScript

```crmscript theme={null}
NSProjectAgent agent;
NSProjectEntity p = agent.GetProjectEntity(4);

p.SetDescription("Let our advance worrying become advance thinking and planning."); // Winston Churchill

p = agent.SaveProjectEntity(p);
```

## Ending a project

In the end, regardless of whether you followed a [project guide][6] or not, a project is either **completed** or **stopped**. It is time to wrap things up and at the same time make sure the project manager and others can learn from it either way.

| Status | Description |
| ------ | ----------- |
| 3      | completed   |
| 4      | stopped     |

### Completed

The date is no longer an estimate, and you can record the actual completion.

```crmscript theme={null}
NSProjectAgent agent;

NSProjectEntity p = agent.GetProjectEntity(2);

p.SetEndDate(getCurrentDateTime());
p.SetCompleted(true);

NSProjectStatus status;
status.SetValue("3");
p.SetProjectStatus(status);

p = agent.SaveProjectEntity(p);
```

### Stopped

Not all projects are viable, and you might need to stop a current project.

The update is very similar to marking it complete. Simply create an NSProjectStatus with value 4 instead of 3.

<Note>
  You should cancel all scheduled upcoming activities before marking it as stopped.
</Note>

## Delete a project

It might be necessary to delete a project if it is no longer appropriate to store it in the database.

```crmscript theme={null}
NSProjectAgent projectAgent;
agent.DeleteProjectEntity(123);
```

[6]: ./guides


## Related topics

- [Update project](/en/mobile/project/update.md)
- [Update multiple records (bulk update)](/en/learn/basics/bulk-update.md)
- [Projects](/en/mobile/project/index.md)
- [Update Project Member](/en/api/reference/restful/agent/project_agent/update-project-member.md)
- [Update Project Members](/en/api/reference/restful/agent/project_agent/update-project-members.md)
- [Project table](/en/api/bulk-operations/bulk-update/reference/project-table.md)
