The document definition contains the Service Field with the text type and an Image Source data source. When using an email image import profile, the Image source string may exceed 256 characters which will produce the following error: "Field value is longer than acceptable length: 256".
The length of the Service Field with the text data type is limited to 256 characters.
To work around this we may create a regular text field in the document definition and assign the value to it with the script rule:
- Create a new text field in the document definition.
- Open field properties > Rules tab > New Rule > Script > Next.
- Uncheck the Read-only checkmark beside the Field Alias to modify the field.
- Click Edit to open Script Editor.
- Paste the following code and replace the Field Alias (can be found on step 3).
- Save changes and close Script Editor > Finish.
Context.Field("ImageSource_script").Text = Context.Document.Pages.ImageSource + ", from: "
+ Context.Document.Batch.Properties.Get("fc_Predefined:EmailSender") + ", to: "