NetSuite高级PDF/HTML - 用自定义字段的URL显示图像

问题描述:

我正在尝试创建一个高级PDF/HTML模板,该模板将使用自定义字段中的URL来显示图像。自定义字段是超链接,字段ID是{custitem_dp_image1}。我使用的图像标签,并引用{} custitem_dp_image1字段作为SRC但我无法保存模板由于以下错误:NetSuite高级PDF/HTML - 用自定义字段的URL显示图像

java.lang.StringIndexOutOfBoundsException: String index out of range: 0 java.lang.InternalError: java.lang.StringIndexOutOfBoundsException: String index out of range: 0

我也尝试下面的代码:

<#if result.custitem_dp_image1?length != 0><img src="${result.custitem_dp_image1}" style="width: 100px; height: 100px;" /> </#if> 

但我收到以下错误,当我试图从已保存的搜索查看高级PDF/HTML模板:

The template cannot be saved due to the following errors: org.xml.sax.SAXParseException; lineNumber: 53; columnNumber: 28; The value of attribute "src" associated with an element type "img" must not contain the '<' character.

*The template was stored as invalid.

我怎样才能得到这个工作并显示图像?

的解决方案是更改自定义字段中键入=自由格式的文本,并使用以下的freemarker代码:

<#if result.custitem_dp_image1?length != 0><img src="${result.custitem_dp_image1}" style="width: 100px; height: 100px;" /> </#if> 

而不是超链接使用您的自定义字段的图像数据类型。

+0

不幸的是这是行不通的,因为图像是从外面NetSuite的另一个资源。图片不在我们的NetSuite帐户上托管。我们只需使用此字段来插入图像的URL。 –

+0

在这种情况下,您可以使用自由格式的文本并将网址放在那里。 –