0

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);
4

0 に答える 0