Acumatica以编程方式从表中获取值的总和

时间:2016-12-26 18:29:35

标签: acumatica

在我的FieldDefaulting事件中,我有以下代码

let bytes = "H€llo".utf8
let dec = decodeUTF8(bytes: bytes, numCharacters: 3)
print(dec)  // H€l

我在Visual Studio中收到无法访问的代码警告,当我发布项目时,字段值为零。

enter image description here

1 个答案:

答案 0 :(得分:3)

Visual Studio报告由于在FieldDefaulting事件处理程序中间抛出PXException导致无法访问的代码:

throw new PXException("Total is "+dec);

要分析中间值,您可以查看PXTrace类。下面的示例显示了如何在Acumatica Trace值中为Sales Order Description:

写入值
public class SOOrderEntryExt : PXGraphExtension<SOOrderEntry>
{
    public void SOOrder_OrderDesc_FieldDefaulting(PXCache sender, PXFieldDefaultingEventArgs e)
    {
        var testDescr = "Test Order Description";
        PXTrace.WriteInformation(string.Format("Sales Order Description: {0}", testDescr));
        e.NewValue = testDescr;
    }
}

enter image description here

enter image description here