Skip to main content

Remove

Removes a role with the specified name.

Syntax

expression.Remove(name, delegateRole);

expression - A variable that represents a ApiFormRoles class.

Parameters

NameRequired/OptionalData typeDefaultDescription
nameRequiredstringThe name of role to be removed.
delegateRoleOptionalstringThe name of the role to which all forms bound to this role will be delegated.

Returns

boolean

Example

This example shows how to remove role.

let doc = editor.GetDocument();
let roles = doc.GetFormRoles();
roles.Add("Customer");
roles.Add("Seller");
roles.Remove("Anyone");
let paragraph = doc.GetElement(0);
roles.GetAllRoles().forEach(role => {
paragraph.AddText(role);
paragraph.AddLineBreak();
});