Server Validation Package - Other Contact "OtherType"
Posted: Thu Aug 27, 2015 2:37 pm
I’m trying to add logic to my server side validation package to prevent users from saving orders that don’t have a specific Other Contact “OtherType” value of "CLIENT". The below logic works, but for ALL of the Other Contact types not just the ones with a specific OtherType . I can't figure out the correct syntax to either filter the list or loop through the list. Please advise…
IList otherContacts = (IList)iOrder["Others"];
if (otherContacts.Count == 0)
{
e.Cancel = true;
e.Reason = "Validation Error! Order can't be saved without a Contact Type of CLIENT.";
}
IList otherContacts = (IList)iOrder["Others"];
if (otherContacts.Count == 0)
{
e.Cancel = true;
e.Reason = "Validation Error! Order can't be saved without a Contact Type of CLIENT.";
}