如何插入自定义表

时间:2016-12-16 16:17:52

标签: acumatica

我有一个自定义发票和备忘录屏幕,我有一个完全自定义的表,我想写一个错误日志条目。由于这与培训解决问题的方式并不相符 - 有没有办法直接这样做?我注意到有一个PXInsert<>命令 - 但是我没有找到任何文档,无论是在Framework帮助中,还是在Stack Overflow上。

我知道我可以为我的自定义表的DAC创建一个Cache对象并使用该缓存的插入命令 - 但我不知道这样做的确切语法(而且我无法做到这一点)。找到一个适合我在培训手册中尝试做的事情)。也许我错过了它。

1 个答案:

答案 0 :(得分:1)

创建Cache对象的语法(或者我认为您可能正在考虑图形)是使用PXGraph对象。这是一个例子:

private void Function()
{
  //TargetGraph is the name of the custom page
  TargetGraph graph = PXGraph.CreateInstance<TargetGraph>();
  //TargetDAC is the name of the custom DAC in your customizations
  TargetDAC dac = new TargetDAC();
  //Set all data to dac
  dac.Log = log;
  //Finally insert and perform the save action for the graph
  graph.LogView.Insert(dac);
  graph.Actions.PressSave();
}

如果这也是您需要的,也许有人可以在这个答案中添加如何从页面中获取错误。