Can I set a variable based on detail records in an Acumatica Report and use it to determine whether to print a detail field?

时间:2019-04-08 13:41:38

标签: acumatica

I have an Acumatica report that creates labels for kit assemblies. The report includes the header as well as custom object detail records attached to the kit asm item. The detail records for a given item could be the same ID or different.

I'm attempting to display or not display a field from my detail records depending on whether all the detail records for this kit asm item have the same ID.

I'm thinking I need to calculate this, store it on the kit asm header and use it to determine whether to display my field, but is there a way to do this calculation entirely within the report without additional code?

1 个答案:

答案 0 :(得分:1)

  

我正在尝试显示或不显示我的详细记录中的字段,具体取决于此套件asm项目的所有详细记录是否具有相同的ID。

如果我正确理解报表设计器将无法执行此操作。局限性在于报表设计人员将单独处理每个详细记录,而无法查看下一个记录。您可以通过在运行时将它们的值缓存在变量中来查看以前的记录,但不知道要处理的下一个详细记录的值。同样,您不能在最后的记录上设置值,因为它们是单独处理的。

  

我想我需要进行计算,将其存储在kit asm标头中,并使用它来确定是否显示我的字段,但是有没有办法完全在报告中进行此计算而无需其他代码?

要计算条件,您将需要以某种方式选择发出SQL。因此,必须使用代码或通过报表编辑器表架构来完成。听起来很难在表模式中打破这种条件。我认为最简单的方法是使用Reports User Defined Function (UDF),但它们并不容易维护。根据您的建议,拥有一个自定义字段可能是最好的解决方案。同一页上的answer建议使用UDF而不是UDF,以提高可维护性。