【问题标题】:How to remove text from a field如何从字段中删除文本
【发布时间】:2021-03-26 03:34:14
【问题描述】:

在 SO Invoice 报告中,我添加了一个从 ARTran 到 FSAppointment 的链接。这样做是为了在报告中包含 FSappointment.LongDescr。一个请求是删除文本“内部注释”以及字符串后面的所有文本。在 LongDescr 中不包含“内部注释”字符串的情况下,我注意到报告输出中打印了一条红色错误消息。我尝试了几种排列,但没有找到解决方案。 这是我的公式

=IIf(InStr([FSAppointment.DescriptionAsPlainText],'Internal Notes')>0,
Left( [FSAppointment.DescriptionAsPlainText], InStr([FSAppointment.DescriptionAsPlainText],'Internal Notes') )
,[FSAppointment.DescriptionAsPlainText])

请注意,我为 LongDescr 字段创建了一个非绑定字段 DescriptionAsPlainText,以便应用漂亮的格式。

以下是错误消息:
在执行 Left(Identifier(FSAppointment.DescriptionAsPlainText), InStr(Identifier(FSAppointment.DescriptionAsPlainText), Const(Internal Notes))) 函数时发生错误: '长度不能小于零。 参数名称:长度'

【问题讨论】:

  • 你如何填充这个未绑定的字段?您使用的是 PXDBScalar 还是 PXDBCalced 属性?如果不能,您可以尝试使用这些属性之一来填充您的字段,然后在报表设计器上的公式上使用它吗?

标签: acumatica


【解决方案1】:

如果 [FSAppointment.DescriptionAsPlainText] 的值为 null,我认为您的代码将失败。在现有代码周围添加 IIF([FSAppointment.DescriptionAsPlainText]=null, 子句以在为 null 的情况下退出。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-04-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-01-02
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多