<?xml version="1.0" encoding="utf-16"?><customize><COR_CUSTOM_FIELD U_RuleName="DOC_10156: Auto-fill matrix with projects" 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="149,139,140,180,65300,133,60090,179,60091,540000988,142,143,182,65301,141,181,60092" U_ItemUID="38" U_Column="1" U_EventType="-2" U_Before="N" U_Mode="-1" U_Refresh="N" U_EasyFunctionRule="" U_ErrorBox=" " U_ErrorStatus=" " U_Creator="" U_LastModified="18.07.2012 17:03:47" U_LastModifiedBy="1" U_Permission=""><U_Expression>/****** General Information *****Creator: coresystems ag, muf@coresystems.chCreate Date: 2012-03-21 ***** StartConfDesc *****This rule fills the project code with the value entered on the document header on the first row and the values entered in the previous row for all other rows***** EndConfDesc ***** ***** Updates *****2012-03-21, muf: Initial Rule2012-07-16, muf: Fill the first row with the value from the document header and use pVal.Row to get the current row*/// Here Project Code (ColumnUid = 31), adjust this if you need to copy a the value of a different column to the next rowstring columnUID = "31"; string ruleName = pVal.RuleInfo.RuleName.ToString();string errorMessage = "Error in Optimizer Rule '" + ruleName + "'";string project = "";try{	Matrix oMatrix = Matrix.GetFromUID(pVal.Form, "38");	int currentRow = pVal.Row - 1;	if (currentRow == 0)	{		// Get the value from the BP Project under Accounting folder		project = TextEdit.GetFromUID(pVal.Form, "157").Value;	}	else	{		// Get the value from the previous row		project = oMatrix.GetValue(columnUID, currentRow - 1);	}	oMatrix.SetValue(columnUID, currentRow, project);}catch(System.Exception ex){	StatusBar.WriteError(errorMessage + ": " + ex.Message);	Debug.WriteMessage(errorMessage + ": " + ex.Message, Debug.DebugLevel.Exception);}return true;</U_Expression></COR_CUSTOM_FIELD></customize>