首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用Conversion Studio by -Increase将便笺导入Microsoft Dynamics AX 2009

使用Conversion Studio by -Increase将便笺导入Microsoft Dynamics AX 2009
EN

Stack Overflow用户
提问于 2011-04-04 23:30:31
回答 1查看 383关注 0票数 0

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

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

所需的结果是将数据带入AX表(就像当前正在运行的那样),并将注释字段连接起来,或者将它们作为单独的注释存储到DocuRef表中作为内部或外部注释。

它不需要在我已经设置好的Conversion Studio项目中设置一个新的块吗?你能给我指出一个可能展示类似过程的资源或如何做到这一点吗?

提前感谢!

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2011-04-27 01:29:32

在追逐兔子到最深的兔子洞后,我发现最简单的方法如下所示:

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

代码语言:javascript
复制
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;

}

下面是我插入注释的方法,以防你也需要这样做:

代码语言:javascript
复制
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;
}
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/5540779

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档