<?xml version="1.0" encoding="utf-16"?><customize><COR_CUSTOM_FIELD U_RuleName="DOC_10150a: Block AR Invoices with BaseType 23/17" U_Type="0" U_Action="0" U_Warning=" " U_WarningText="" U_WarningBox=" " U_WarningStatus=" " U_Active="Y" U_FormTypeBasis="" U_ItemUIDBasis="" U_ColumnBasis="" U_FormType="133,60091" U_ItemUID="" U_Column="" U_EventType="16" U_Before="Y" U_Mode="-1" U_Refresh=" " U_EasyFunctionRule="" U_Creator="" U_LastModified="18.07.2012 14:06:52" U_LastModifiedBy="1" U_Permission="" U_ErrorBox=" " U_ErrorStatus=" "><U_Expression>/****** General Information *****Creator: coresystems ag, laja@coresystems.chCreate Date: 2012-04-16 ***** StartConfDesc *****Block all invoices which are based on sales orders or sales quotations. Generally, this produces more reliable reporting in a variety of use case scenarios.***** EndConfDesc ***** ***** Updates *****2012-04-16, laja: Initial Rule2012-07-16, muf: use status bas error message instead of message box*/string ruleName = pVal.RuleInfo.RuleName.ToString();string errorMessage = "Error in Optimizer Rule '" + ruleName + "'"; string msgOrder = "Direct Copy from Sales Order to A/R Invoice or A/R Reserve Invoice is not allowed. Please book a Delivery first.";string msgQuotation = "Direct Copy from Sales Quotation to A/R Invoice or A/R Reserve Invoice is not allowed. Please book Sales Order and Delivery first.";try{	Matrix mtr = Matrix.GetFromUID(pVal.Form, "38");	for(int i = 0; i &lt; mtr.Rows.Count - 1; i++)	{		if(mtr.GetValue("43", i).ToString() == "17")		{			StatusBar.WriteError(msgOrder);			return false;		}			if(mtr.GetValue("43", i).ToString() == "23")		{			StatusBar.WriteError(msgQuotation);			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><COR_CUSTOM_FIELD U_RuleName="DOC_10150b: Block AR Invoices with BaseType 23/17" U_Type="0" U_Action="0" U_Warning="N" U_WarningText="" U_WarningBox="N" U_WarningStatus="N" U_Active="Y" U_FormTypeBasis="" U_ItemUIDBasis="" U_ColumnBasis="" U_FormType="133,60091" U_ItemUID="1" U_Column="" U_EventType="1" U_Before="Y" U_Mode="-1" U_Refresh="N" U_EasyFunctionRule="" U_Creator="" U_LastModified="18.07.2012 14:07:03" U_LastModifiedBy="1" U_Permission="" U_ErrorBox=" " U_ErrorStatus=" "><U_Expression>/****** General Information *****Creator: coresystems ag, laja@coresystems.chCreate Date: 2012-04-16 ***** StartConfDesc *****Block all invoices which are based on sales orders or sales quotations. Generally, this produces more reliable reporting in a variety of use case scenarios.***** EndConfDesc ***** ***** Updates *****2012-04-16, laja: Initial Rule2012-07-16, muf: use status bas error message instead of message box*/string ruleName = pVal.RuleInfo.RuleName.ToString();string errorMessage = "Error in Optimizer Rule '" + ruleName + "'"; string msgOrder = "Direct Copy from Sales Order to A/R Invoice or A/R Reserve Invoice is not allowed. Please book a Delivery first.";string msgQuotation = "Direct Copy from Sales Quotation to A/R Invoice or A/R Reserve Invoice is not allowed. Please book Sales Order and Delivery first.";try{	Matrix mtr = Matrix.GetFromUID(pVal.Form, "38");	for(int i = 0; i &lt; mtr.Rows.Count - 1; i++)	{		if(mtr.GetValue("43", i).ToString() == "17")		{			StatusBar.WriteError(msgOrder);			return false;		}			if(mtr.GetValue("43", i).ToString() == "23")		{			StatusBar.WriteError(msgQuotation);			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>