10-05-2010 02:42 AM
I've been scratching my head over this for a cupple of days now and still cant understand why I'm unable to GetCriteriaColumn from any other table than TBL_CONTACT. Any pointers/help will be most appreciated
public List<actContact> autheriseContact(string postCode, string serialNumber, string phoneNumber) {
CriteriaColumn cSerialNumber = actFwk.Lookups.GetCriteriaColumn("TBL_CONTACT", "USER2", true);
CriteriaColumn cPhoneNumber0 = actFwk.Lookups.GetCriteriaColumn("TBL_PHONE", "NUMBERDISPLAY", true);
CriteriaColumn cPhoneNumber1 = actFwk.Lookups.GetCriteriaColumn("TBL_CONTACT", "CUST_2ndPhone_053109522", true);
CriteriaColumn cPhoneNumber2 = actFwk.Lookups.GetCriteriaColumn("TBL_CONTACT", "CUST_3rdPhone_053115383", true);
CriteriaColumn cPhoneNumber3 = actFwk.Lookups.GetCriteriaColumn("TBL_CONTACT", "CUST_AsstPhone_053123463", true);
CriteriaColumn cPostcode = actFwk.Lookups.GetCriteriaColumn("TBL_ADDRESS.POSTALCODE", false);
Criteria[] theCriteria = new Criteria[] {
new Criteria(LogicalOperator.And,(byte)0, (byte)0, cPostcode, OperatorEnum.EqualTo, postCode),
new Criteria(LogicalOperator.And,(byte)0, (byte)0, cSerialNumber, OperatorEnum.EqualTo, serialNumber),
new Criteria(LogicalOperator.Or,(byte)0, (byte)0, cPhoneNumber0, OperatorEnum.EqualTo, phoneNumber),
new Criteria(LogicalOperator.Or,(byte)0, (byte)0, cPhoneNumber1, OperatorEnum.EqualTo, phoneNumber),
new Criteria(LogicalOperator.Or,(byte)0, (byte)0, cPhoneNumber2, OperatorEnum.EqualTo, phoneNumber),
new Criteria(LogicalOperator.End,(byte)0, (byte)0, cPhoneNumber3, OperatorEnum.EqualTo, phoneNumber)
};
ContactLookup theLookup = actFwk.Lookups.LookupContactsReplace(theCriteria, true, true);
ContactList contactL = theLookup.GetContacts(null);
if (contactL.Count() > 0)
{
theContact.Add(new actContact(contactL[0].FullName, contactL[0].FullName, contactL[0].LastName, contactL[0].CompanyID, contactL[0].Company, contactL[0].ID));
} else {
theContact.Add(new actContact("001", "No Match Found", "The Query of Postcode, Serial Number and Phone Number returned no results"));
}
return theContact;
}
10-08-2010 01:26 AM
Ping! has any one got any idea why im exprencing this?
10-11-2010 09:31 AM
I'm unsure why you're unable to get criteria columns for columns that aren't in the contact table, but you should be able to get zip code and phone number criteria from the contact table:
TBL_CONTACT.HOME_POSTALCODE
TBL_CONTACT.BUSINESS_POSTALCODE
TBL_CONTACT.MOBILE_PHONE
TBL_CONTACT.ALTERNATE_PHONE
TBL_CONTACT.BUSINESS_PHONE
I'm just pulling these from a list of all field descriptors for contacts.