Custom Validation Package - Order.Tasks.CDFLine
Posted: Tue Nov 24, 2015 4:18 pm
I’m trying to add logic to my server side validation package to prevent users from saving orders where the "Fee:" and "Line:" fields of the "Details" section of the "Requested Tasks" screen are empty for tasks with a description like "Invoice". I have all the logic worked out except what Type of an object is Order.Tasks.CDFLine. The field code browser does show the object reference, but not what type. I was able to determine that the "Fee:" field is a decimal type object, but can't figure out the type of the "Line:" field. I'm not concerned with what the value is, only if it's empty or not empty.
Field Code Browser Reference:
Order.Tasks.CDFLine
Order.Tasks.Fee
Logic:
foreach (var task in tasks)
{
TaskStatusType status = (TaskStatusType)((IOrderItem)task).GetProperty("Status");
string description = (string)((IOrderItem)task).GetProperty("Description");
if (status.ToString() == "Received" && description.ToUpper().Contains("INVOICE"))
{
string cdfline = (string)((IOrderItem)task).GetProperty("CDFLine");//***NEED TO KNOW WHAT TYPE OF OBJECT CDFLINE IS*****
decimal fee = (decimal)((IOrderItem)task).GetProperty("Fee");
if (fee == 0 && cdfline == null)
{
taskNotComplete = taskNotComplete + 1;
}
}
}
Field Code Browser Reference:
Order.Tasks.CDFLine
Order.Tasks.Fee
Logic:
foreach (var task in tasks)
{
TaskStatusType status = (TaskStatusType)((IOrderItem)task).GetProperty("Status");
string description = (string)((IOrderItem)task).GetProperty("Description");
if (status.ToString() == "Received" && description.ToUpper().Contains("INVOICE"))
{
string cdfline = (string)((IOrderItem)task).GetProperty("CDFLine");//***NEED TO KNOW WHAT TYPE OF OBJECT CDFLINE IS*****
decimal fee = (decimal)((IOrderItem)task).GetProperty("Fee");
if (fee == 0 && cdfline == null)
{
taskNotComplete = taskNotComplete + 1;
}
}
}