Sunday, June 23, 2019

C# > update > Updating an expense report to have it approved.

Below is a sample code which will update the complete checkbox on the expense report. Once this field is updated it will set the status of the expense report to Pending Accounting Approval
Please note you need to have valid login session for this to work.

if (stat.isSuccess)
{
// Creating the report object that is going to be updated.
ExpenseReport report = new ExpenseReport();
report.internalId = "1595";
report.complete = true;
report.completeSpecified = true;

// Sending in the update request.
WriteResponse res = nss.update(report);

// Checking the status of the request.
if (res.status.isSuccess)
{
Console.WriteLine(" Expense Report Successfully Updated");
Console.Read();
}
else
{
Console.WriteLine("Record Not Updated");
Console.Read();
}
}

No comments:

Post a Comment