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

> How to create a quote alternative with CRMScript.

## NSQuoteAlternative CreateDefaultQuoteAlternative()

Creates an alternative with default values.

```crmscript theme={null}
NSQuoteAgent qa;
NSQuoteAlternative alt = qa.CreateDefaultQuoteAlternative();
alt.SetName("plan a");
alt.SetQuoteVersionId(1);

// add quote lines

alt = qa.SaveQuoteAlternative(alt);
```

## NSQuoteAlternative CreateQuoteAlternative(Integer quoteVersionId, String quoteAlternativeName, String quoteAlternativeDescription)

Creates an alternative for a specific version.

```crmscript theme={null}
NSQuoteAgent qa;
NSQuoteAlternative alt = qa.CreateQuoteAlternative(1,"plan b","optimized for home office");

// add quote lines

alt = qa.SaveQuoteAlternative(alt);
```

## NSQuoteAlternative CopyQuoteAlternative(Integer quoteVersionId, Integer quoteAlternativeId, String quoteAlternativeName)

A variant of `CreateQuoteAlternative()` that clones an alternative into the new one. This is an efficient way of creating multiple alternatives with small variations.

```crmscript theme={null}
NSQuoteAgent qa;
NSQuoteAlternative alt = qa.CopyQuoteAlternative(1, 2,"plan c");

// modify quote lines

alt = qa.SaveQuoteAlternative(alt);
```

## Set alternatives

```crmscript theme={null}
NSQuoteAgent qa;

NSQuoteAlternative[] alternatives;

// populate array

NSQuoteVersion version = qa.GetQuoteVersion(1);
version.SetQuoteAlternatives(alternatives);
qa.SaveQuoteVersion(1);
```

## Reference

### Frequently used QuoteAlternative fields

| Field                | Description                            |
| :------------------- | :------------------------------------- |
| quotealternative\_id | ID                                     |
| QuoteVersionId       | the version the alternative belongs to |
| Name                 | label for UI                           |
| VAT                  | as calculated amount                   |
| EarningPercent       | in percent of total                    |
| EarningAmount        | as amount                              |
| TotalPrice           | calculated                             |

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

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


## Related topics

- [Create quote](/en/automation/crmscript/howto/quote/create.md)
- [Create Quote Alternative](/en/api/reference/restful/agent/quote_agent/create-quote-alternative.md)
- [Create Default Quote Alternative](/en/api/reference/restful/agent/quote_agent/create-default-quote-alternative.md)
- [Add alternatives to a quote](/en/sale/learn/quote/add-alternative.md)
- [SuperOffice.WebApi.Data.Quote CreateQuoteAlternativeRequest](/en/api/reference/webapi/SuperOffice.WebApi.Data.Quote_CreateQuoteAlternativeRequest.md)
- [NSQuoteAgent](/en/automation/crmscript/reference/CRMScript.NetServer.NSQuoteAgent.md)
