SetAlias
Sets the alias attribute to the current container.
Syntax
expression.SetAlias(alias);
expression
- A variable that represents a ApiBlockLvlSdt class.
Parameters
Name | Required/Optional | Data type | Default | Description |
---|---|---|---|---|
alias | Required | string | The alias which will be added to the current container. |
Returns
This method doesn't return any data.
Example
This example sets the alias attribute to the container.
let doc = Api.GetDocument();
let blockLvlSdt = Api.CreateBlockLvlSdt();
blockLvlSdt.GetContent().GetElement(0).AddText("This is a block text content control with alias '№1'.");
blockLvlSdt.SetAlias("№1");
doc.AddElement(0, blockLvlSdt);
let alias = blockLvlSdt.GetAlias();
let paragraph = doc.GetElement(1);
paragraph.AddText("Alias: " + alias);