使用 Conversion Studio by To-Increase 将 Notes 导入 Microsoft Dynamics AX 2009

发布于 2024-10-30 13:19:24 字数 368 浏览 1 评论 0原文

目前,我正在使用 Conversion Studio 引入 CSV 文件并将内容存储在 AX 表中。这部分正在发挥作用。我定义了一个块并且字段已正确映射。

CSV 文件包含多个注释列,例如 Comments-1、Comments-2 等。这些列的数量是固定的。公共评论标记为 Comments-1...5,私人评论标记为 Private-Comment-1...5。

期望的结果是将数据带入 AX 表(如当前工作),并连接注释字段或将它们作为单独的注释存储到 DocuRef 表中作为内部或外部注释。

难道不需要在我已经设置的 Conversion Studio 项目中设置一个新块吗?您能给我指出一个可能显示类似过程或如何执行此操作的资源吗?

提前致谢!

Currently, I'm using Conversion Studio to bring in a CSV file and store the contents in an AX table. This part is working. I have a block defined and the fields are correctly mapped.

The CSV file contains several comments columns, such as Comments-1, Comments-2, etc. There are a fixed number of these. The public comments are labeled as Comments-1...5, and the private comments are labeled as Private-Comment-1...5.

The desired result would be to bring the data into the AX table (as is currently working) and either concatenate the comment fields or store them as separate comments into the DocuRef table as internal or external notes.

Would it not require just setting up a new block in the Conversion Studio project that I already have setup? Can you point me to a resource that maybe shows a similar procedure or how to do this?

Thanks in advance!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

五里雾 2024-11-06 13:19:24

在将兔子追入兔子洞的最深处后,我发现最简单的方法是这样的:

重写文档处理程序(扩展AppDataDocumentHandler)的onEntityCommit方法,如下所示

AppEntityAction onEntityCommit(AppDocumentBlock documentBlock, AppBlock fromBlock, AppEntity toEntity)
{

  AppEntityAction ret;
  int64 recId; // Should point to the record currently being imported into CMCTRS
  ;
  ret = super(documentBlock, fromBlock, toEntity);
  recId = toEntity.getRecord().recId;
  // Do whatever you need to do with the recId now
  return ret;

}

:我插入注释的方法,以防您也需要:

private static boolean insertNote(RefTableId _tableId, int64 _docuRefId, str _note, str _name, boolean _isPublic)
{
  DocuRef docuRef;
  boolean insertResult = false;
  ;
  if (_docuRefId)
  {
    try
    {
        docuRef.clear();
        ttsbegin;
        docuRef.RefCompanyId = curext();
        docuRef.RefTableId = _tableId;
        docuRef.RefRecId = _docuRefId;
        docuRef.TypeId = 'Note';
        docuRef.Name = _name;
        docuRef.Notes = _note;
        docuRef.Restriction = (_isPublic) ? DocuRestriction::External : DocuRestriction::Internal;
        docuRef.insert();
        ttscommit;

        insertResult = true;
    }
    catch
    {
        ttsabort;
        error("Could not insert " + ((_isPublic) ? "public" : "private") + " comment:\n\n\t\"" + _note + "\"");
    }
  }
  return insertResult;
}

After chasing the rabbit down the deepest of rabbit holes, I discovered that the easiest way to do this is like so:

Override the onEntityCommit method of your Document Handler (that extends AppDataDocumentHandler), like so:

AppEntityAction onEntityCommit(AppDocumentBlock documentBlock, AppBlock fromBlock, AppEntity toEntity)
{

  AppEntityAction ret;
  int64 recId; // Should point to the record currently being imported into CMCTRS
  ;
  ret = super(documentBlock, fromBlock, toEntity);
  recId = toEntity.getRecord().recId;
  // Do whatever you need to do with the recId now
  return ret;

}

Here is my method to insert the notes, in case you need that too:

private static boolean insertNote(RefTableId _tableId, int64 _docuRefId, str _note, str _name, boolean _isPublic)
{
  DocuRef docuRef;
  boolean insertResult = false;
  ;
  if (_docuRefId)
  {
    try
    {
        docuRef.clear();
        ttsbegin;
        docuRef.RefCompanyId = curext();
        docuRef.RefTableId = _tableId;
        docuRef.RefRecId = _docuRefId;
        docuRef.TypeId = 'Note';
        docuRef.Name = _name;
        docuRef.Notes = _note;
        docuRef.Restriction = (_isPublic) ? DocuRestriction::External : DocuRestriction::Internal;
        docuRef.insert();
        ttscommit;

        insertResult = true;
    }
    catch
    {
        ttsabort;
        error("Could not insert " + ((_isPublic) ? "public" : "private") + " comment:\n\n\t\"" + _note + "\"");
    }
  }
  return insertResult;
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文