0

現在、Conversion Studioを使用してCSVファイルを取り込み、その内容をAXテーブルに保存しています。この部分は機能しています。ブロックを定義しましたが、フィールドは正しくマップされています。

CSVファイルには、Comments-1、Comments-2などのいくつかのコメント列が含まれています。これらには固定数があります。パブリックコメントにはComments-1...5のラベルが付けられ、プライベートコメントにはPrivate-Comment-1...5のラベルが付けられます。

望ましい結果は、データをAXテーブルに取り込み(現在機能しているように)、コメントフィールドを連結するか、個別のコメントとして内部または外部のメモとしてDocuRefテーブルに格納することです。

すでに設定したConversionStudioプロジェクトに新しいブロックを設定するだけでよいのではないでしょうか。同様の手順またはこれを行う方法を示している可能性のあるリソースを教えていただけますか?

前もって感謝します!

4

1 に答える 1

0

ウサギの穴の奥深くでウサギを追いかけた後、これを行う最も簡単な方法は次のようなものであることがわかりました。

次のように、ドキュメントハンドラー(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;
}
于 2011-04-26T17:29:32.067 に答える