使用c#和API将回复插入现有SugarCRM案例

使用c#和API将回复插入现有SugarCRM案例,c#,.net,sugarcrm,C#,.net,Sugarcrm,我有下面的代码通过C#在SugarCRM中创建一个案例 我在问,有人知道我将如何通过c#向sugarCRM api添加关于这个案例的回复吗 NameValueCollection fieldListCollection = new NameValueCollection(); fieldListCollection.Add("id", string.Empty); fieldListCollection.Add("name", "Something went wrong"); fieldLis

我有下面的代码通过C#在SugarCRM中创建一个案例

我在问,有人知道我将如何通过c#向sugarCRM api添加关于这个案例的回复吗

NameValueCollection fieldListCollection = new NameValueCollection();

fieldListCollection.Add("id", string.Empty);
fieldListCollection.Add("name", "Something went wrong");
fieldListCollection.Add("description", "This software is not working");
fieldListCollection.Add("status", "test"); //New, Assigned, Closed, Pending Input, Rejected, Duplicate
fieldListCollection.Add("priority", "test"); //High, Medium, Low
fieldListCollection.Add("account_id", AccountId); // Don't pass this if you don't want to associate an account with it
fieldListCollection.Add("contact_id", ContactId); // Don't pass this if you don't want to associate with this contact with it

SugarCRM.name_value[] fieldList = new SugarCRM.name_value[fieldListCollection.Count];

int count = 0;
foreach (string name in fieldListCollection)
{
   foreach (string value in fieldListCollection.GetValues(name))
   {
      SugarCRM.name_value field = new SugarCRM.name_value();
      field.name = name; field.value = value;
      fieldList[count] = field;
   }
   count++;
}

SugarCRM.new_set_entry_result result = SugarClient.set_entry(SessionID, "Cases", fieldList); //Accounts, Incidents, Contacts, Cases
Console.WriteLine("New ID: " + result.id);

你能不能不遵循同样的模式
fieldListCollection.Add(
?您的
SugarCRM
的结构是什么样子的?请在这里查找我认为您可以使用/执行的功能