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

# Create and update companies

> How to create and update companies with CRMScript.

## Void setValue(String column, String value)

Sets a named field to the given value. Look up names in the [reference section down below](#reference), or check out the [class reference][1].

<Note>
  Both parameters are strings! Remember to use quotes even for IDs.

  You must call `save()` after setting all applicable values to actually create or update the company.
</Note>

```crmscript theme={null}
Company c;
c.setValue("name", "SuperOffice");
c.save();
```

## Integer save()

Saves a new or updated company and returns its ID.

```crmscript theme={null}
Company c;
c.setValue("name", "SuperOffice");
c.setValue("domain", "superoffice.com");
printLine(c.save().toString());
```

## Reference

### Frequently used values

| Parameter | Database field   | Description                                                                           |
| :-------- | :--------------- | :------------------------------------------------------------------------------------ |
| name      | name             | The name of the company                                                               |
| phone     | phone            | The company's phone number                                                            |
| domain    | company\_domain  | A display-version of the company's domain                                             |
| priority  | ticket\_priority | The ID of the default priority for this company.<br />NULL or -1 if not set.          |
| language  | cust\_lang       | The ID of the default customer language for this company.<br />NULL or -1 if not set. |

### Connected persons

| Parameter          | Database field     | Description                                                                                              |
| :----------------- | :----------------- | :------------------------------------------------------------------------------------------------------- |
| ourContact         | associate\_id      | The ID (`ejuser.id`) of the internal employee handling sale to this company                              |
| supportAssociateId | supportAssociateId | The ID (`ejuser.id`) or username of the internal employee handling support to this company               |
| primContact        | supportPerson      | The ID (`customer.id`) of the primary contact in this company<br />the counterpart of supportAssociateId |

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

[1]: /en/automation/crmscript/reference/CRMScript.Native.Company#setvaluestringstring

[2]: ../../../../database/tables/contact


## Related topics

- [Create and update customers](/en/automation/crmscript/howto/contact/create-customer.md)
- [Create a new company](/en/company/learn/create.md)
- [Update multiple records (bulk update)](/en/learn/basics/bulk-update.md)
- [Update a SuperOffice CRM Company action](/integrations/zapier/howto/actions/update-company.md)
- [Update contact or company](/en/mobile/contact/update.md)
