This code snippet demonstrates how users can add a Budget record via Web Services using C#.Net.
Budget budget = new Budget();// YearRecordRef year = new RecordRef();year.type = RecordType.accountingPeriod;year.typeSpecified = true;year.internalId = "52"; //Internal ID for fiscal year, not individual periods; else, Invalid Reference Error is returned//Budget categoryRecordRef category = new RecordRef();category.type = RecordType.budgetCategory;category.typeSpecified = true;category.internalId = "2"; //Should be Active; else, Invalid Reference Error is returned//account on which you are allocating the budgetRecordRef account = new RecordRef();account.type = RecordType.account;account.typeSpecified = true;account.internalId = "1";budget.year = year;budget.category = category;budget.account = account;// specify the period - divided into 12 periods or monthsbudget.periodAmount1 = 500;budget.periodAmount1Specified = true;WriteResponse writeRes = _service.add(budget);
No comments:
Post a Comment