The batch name is not changed with the script stage


There is a script stage created to modify the batch name, but the batch name is not changed.

When navigating to Administration and Monitoring Console > Processing Monitor > Event log there are the following errors.



Error: A name cannot contain character 'x' at
Error: The name is too long. Maximum length is 90.


  • The modified batch name contains forbidden characters (e.g. the ones used in Windows paths). 
  • The modified batch name exceeds the limit of 90 characters.


If the error is caused by the forbidden characters (e.g. slashes, colons, etc.), the name can be edited to replace these characters with an empty character or a replacement character.

//C# eaxmple
var name = Batch.Documents[0].Field("Invoice Layout\\Name").Text;
var name_edited = name.Replace(":", "+");

Batch.Name += "_"+ name_edited;

If the error is caused by the exceeded 90-character limit, the string can be trimmed before assigning it to the batch name.

//C# eaxmple
Batch.Name = batch_name.Substring(0, 90);

Additional information

String.Replace Method (

String.Substring Method (

Have more questions? Submit a request



  • Avatar

    Permanently deleted user

    Is there a list of all forbidden characters?

  • Avatar

    Blake Smith

    What is the proper way to replace multiple invalid characters?


Please sign in to leave a comment.

Recently viewed