我使用GitHub中的exactonline-api-dotnet-client从C#访问ExactOnline。 当我尝试添加新的现金付款时,我使用了代码:
var cashPayments = new List<ExactOnline.Client.Models.FinancialTransaction.CashEntryLine>();
cashPayments.Add(new ExactOnline.Client.Models.FinancialTransaction.CashEntryLine()
{ });
var cashPaymentsEnumerable = cashPayments.AsEnumerable();
var journalCode = "10"; //Code 10 = cashbook
var cash = new ExactOnline.Client.Models.FinancialTransaction.CashEntry()
{
JournalCode = journalCode,
CashEntryLines = cashPaymentsEnumerable
};
bool created = exactClient.For<ExactOnline.Client.Models.FinancialTransaction.CashEntry>().Insert(ref cash);
执行创建的行后,会引发异常:
Missing cash entry lines. Cash entry lines must be supplied to create a new cash entry.
这是因为CashEntryLine是空的(在某处记录哪些字段是强制性的? 或者我做错了什么?