0

acumatica API を使用してケースを挿入し、そのケースに属性を挿入するコードを作成しました。(これは正常に機能します)

ケースへの属性の挿入は次のとおりです。正しく機能します。

// Add the attribute to the Case
CR306000 = context.CR306000GetSchema();
context.CR306000Clear();
CR306000Content[] resultAttributes = context.CR306000Submit(
new Command[] { 
    new Value { Value = sCaseID, LinkedCommand = CR306000.CaseSummary.CaseID, Commit = true },
    new Value { Value = "Asset ID", LinkedCommand = CR306000.Attributes.Attribute },
    new Value { Value = "X22345", LinkedCommand = CR306000.Attributes.Value, Commit = true },
CR306000.Actions.Save
}
);

関連するタスクを挿入しようとすると、タスクが作成されません。表示されるエラー メッセージは、Error #98: View Activites does not exist です。

関連タスクをケースに挿入する方法について何か提案はありますか?

タスクを挿入しないコードを次に示します。

CR306010Content CR306020 = context.CR306010GetSchema();
context.CR306020Clear();
context.CR306020Submit( 
new Command[]
{
new Value { Value = "New Task For CaseID=[" +sCaseID + "]", LinkedCommand = CR306020.Details.Summary, Commit=true },
new Value { Value = sCaseID, LinkedCommand = CR306020.Details.RelatedEntity },
new Value { Value = "000001", LinkedCommand = new Field { ObjectName = CR306020.Details.RelatedEntity.ObjectName, FieldName = "RefNoteID" } },
new Value { Value = "False", LinkedCommand = CR306020.Details.Billable },
new Value { Value = "Administrative", LinkedCommand = CR306020.Details.Workgroup },
new Value { Value = "EP00000002", LinkedCommand = CR306020.Details.Owner },
new Value { Value = "X", LinkedCommand = CR306020.Details.Project },
new Value { Value = "Task Description", LinkedCommand = CR306020.Details.Task},
new Value { Value = "Open", LinkedCommand = CR306020.Details.Status, Commit = true },
CR306020.Actions.SaveClose
}
);
4

1 に答える 1

0

これについて支援してくれた Dhiren に感謝します。

try
{

  var commands = new LocalAPI.Command[]
  {
    new LocalAPI.Value { Value = strCaseNumber,  LinkedCommand = CR306000.CaseSummary.CaseID, Commit = true },
    CR306000.Actions.NewTask,
  };
  screen.CR306000Submit(commands);
}
catch (Exception x1)
{
  message = x1.Message;
}

// Adds a task to the case or order linked on NoteID and RefNoteID
LocalAPI.CR306020Content CR306020 = screen.CR306020GetSchema();
var taskresult = screen.CR306020Submit(
                    new LocalAPI.Command[]
                        {
                            new LocalAPI.Value { Value = "New Task - N7", LinkedCommand = CR306020.Details.Summary  },
                            new LocalAPI.Value { Value = "X", LinkedCommand = CR306020.Details.Project  },
                            new LocalAPI.Value { Value = DateTime.Now.ToString(), LinkedCommand = CR306020.Details.StartDate},
                            new LocalAPI.Value { Value = DateTime.Now.AddDays(18).ToString(), LinkedCommand = CR306020.Details.DueDate},
                            new LocalAPI.Value { Value = "FINANCE", LinkedCommand = CR306020.Details.Workgroup},
                            new LocalAPI.Value { Value = "EP00000003", LinkedCommand = CR306020.Details.AssignedTo},
                            new LocalAPI.Value { Value = "Normal", LinkedCommand = CR306020.Details.Priority},
                            new LocalAPI.Value { Value = "Open", LinkedCommand = CR306020.Details.Status},
                            new LocalAPI.Value { Value = "false" , LinkedCommand = CR306020.Details.Reminder},
                            new LocalAPI.Value { Value = "More and more stuff will be added in this section", LinkedCommand = CR306020.Details.ActivityDetails},

                            CR306020.Actions.Save
                        });
于 2015-02-16T23:00:31.763 に答える