How to remove specific characters from the end of the field value?
- Navigate the document definition and open the properties of the field that should be corrected.
- Navigate to the Data tab and click Edit in the AutoCorrect section.
- Put a checkmark in the Use Script field to enable the autocorrection script and click Edit:
- Paste the following C# code into the Script Editor:
Value.Text = Value.Text.Remove(Value.Text.Length - 3);
The script above will remove "ABC" from the end of the field value.
To adjust it to ones needs, the "ABC" string in the if condition should be replaced with the one that is expected to be removed from the end of the field value, and number 3 should be replaced with the number of characters that need to be removed.