Code: Select all
IOrder order = ...
// Get the first CDF.
IList CDFs = (IList)order.GetProperty("CDFs");
IOrderItem cdf = (IOrderItem)CDFs[0];
// Get the next unused line in the "ServicesNotShoppedFor" section.
IOrderItem nextLine = (IOrderItem)cdf.Invoke("NextAvailableLine", CDFSectionType.ServicesNotShoppedFor);
// Make sure we got a line since there is a maximum number the section can hold (typically around 100).
if (nextLine == null)
{
// We can't add the line. Do something else!
return;
}
// Set description on first charge. Line will inherit the description if only one charge.
IList charges = (IList)nextLine.GetProperty("Charges");
IOrderItem firstCharge = (IOrderItem)charges[0];
firstCharge.SetProperty("Description", "Our charge");