<?xml version="1.0" encoding="utf-16"?><customize><COR_CUSTOM_FIELD U_RuleName="BUP:10171:Verify BP Email when generating a Doc" U_Type="0" U_Action="0" U_Warning=" " U_WarningText="" U_WarningBox=" " U_WarningStatus=" " U_Active="N" U_FormTypeBasis="" U_ItemUIDBasis="" U_ColumnBasis="" U_FormType="133,140,180,179" U_ItemUID="1" U_Column="" U_EventType="1" U_Before="Y" U_Mode="-1" U_Refresh=" " U_EasyFunctionRule="" U_ErrorBox=" " U_ErrorStatus=" " U_Creator="" U_LastModified="7/26/2012 10:01:02 AM" U_LastModifiedBy="1" U_Permission=""><U_Expression>/****** General Information *****Creator: coresystems software USA, lajaCreate Date: 2012 07 10 ***** StartConfDesc *****If the BP email address is not present when generating a marketing document, then advise to add and don't add document.***** EndConfDesc ***** ***** Updates *****YYYY-MM-DD, name: Update Comment*/string ruleName = pVal.RuleInfo.RuleName.ToString();string errorMessage = "Error in [Optimizer Rule] '" + ruleName + "'";try {	string CardNumber = TextEdit.GetFromUID(pVal.Form, "4").Value;		string mySQL = "SELECT TOP 1 COALESCE(E_Mail,'')  FROM OCRD WHERE CardCode='" + CardNumber + "'";	string myEmail = LayoutHelper.LD.QueryData(mySQL);	string myRegex = @"^[\w!#$%&amp;'*+\-/=?\^_`{|}~]+(\.[\w!#$%&amp;'*+\-/=?\^_`{|}~]+)*"		+ "@"		+ @"((([\-\w]+\.)+[a-zA-Z]{2,4})|(([0-9]{1,3}\.){3}[0-9]{1,3}))$";			bool validEmail = System.Text.RegularExpressions.Regex.IsMatch(		myEmail, 		myRegex, 		System.Text.RegularExpressions.RegexOptions.IgnoreCase);		if (!validEmail) {		MessageBox.Show("Please define an email address in the BP record", "OK");		return false;	}}catch(System.Exception ex){	MessageBox.Show(errorMessage + ": \n" + ex.Message, "OK");	StatusBar.WriteError(errorMessage + ": " + ex.Message);	Debug.WriteMessage(errorMessage + ": " + ex.Message, Debug.DebugLevel.Exception);}return true;</U_Expression></COR_CUSTOM_FIELD></customize>