我正在尝试在 Workday 的 Financial_management API 中使用“Put_Ledger”函数,但是当我尝试将其添加object[]
到对象时(正如它在 API 中声明的那样),我不断收到错误消息。
Workday 对解决这个问题没有任何帮助。这是代码示例。对象被创建,然后添加到父对象:
Ledger_Only_DataType ldOnly = new Ledger_Only_DataType
{
Actuals_Ledger_ID = "1234567",
Can_View_Budget_Date = true
};
//Commitment_Ledger_data
Commitment_Ledger_Data__Public_Type cl = new Commitment_Ledger_Data__Public_Type
{
Commitment_Ledger_Reference = ledgerObject,
Enable_Commitment_Ledger = true,
Spend_Transaction_Data = st,
Payroll_Transaction_Data = pt
};
// This is where the error occurs:
ldOnly.Commitment_Ledger_Data = cl;
错误信息:
“无法将类型 'CallWorkdayAPI.Financial_Management.Commitment_Ledger_Data__Public_Type' 隐式转换为 'CallWorkdayAPI.Financial_Management.Commitment_Ledger_Data__Public_Type[]”