Tech Tip: Syntax Error 1637
PRODUCT: 4D | VERSION: 21 | PLATFORM: Mac & Win
Published On: February 23, 2026
The syntax error number 1637 is details as:
"This entity selection cannot be altered."
This can be an issue when trying to modify an entity selection. Entity selections can be Sharable or Alterable. Sharable entity selections can be shared in shared objects and shared collections, and can be passed as a parameter between processes and workers, but because of this, it cannot be directly modified (altered). Most functions that create an entity selection will be a Sharable. While Alterable entity selections are the oposite, not able to be shared, but can be directly altered.
An entity selection can be checked if it is Alterable by using the .isAlterable() function. A simple way to create an Alterable entity selection is to create a copy of is. This can be done with the .copy() function.
For example the following code will check if an entity selection is alterable and perform .add():
Alternatively, a .copy() can just be applied anytime a .add() is being performed, however, it is important to be aware of the limitations of Alterable entity selections.
"This entity selection cannot be altered."
This can be an issue when trying to modify an entity selection. Entity selections can be Sharable or Alterable. Sharable entity selections can be shared in shared objects and shared collections, and can be passed as a parameter between processes and workers, but because of this, it cannot be directly modified (altered). Most functions that create an entity selection will be a Sharable. While Alterable entity selections are the oposite, not able to be shared, but can be directly altered.
An entity selection can be checked if it is Alterable by using the .isAlterable() function. A simple way to create an Alterable entity selection is to create a copy of is. This can be done with the .copy() function.
For example the following code will check if an entity selection is alterable and perform .add():
| If ($myEntitySelection.isAlterable()) $myEntitySelection.add($newEntity) Else $myEntitySelection:=$myEntitySelection.copy().add($newEntity) End if |
Alternatively, a .copy() can just be applied anytime a .add() is being performed, however, it is important to be aware of the limitations of Alterable entity selections.