ST1
3 months agoNew Contributor III
Validation Intersection Error
I am using a below code to display Intersection Error. The code works perfectly fine- except for one thing.
The problem is when the error is - Invalid Member Name.Entity,2010
It only outputs- "Invalid Member Name" (may be because it gets period)
Is there a way to update below code to also show Entity ,2010- instead of just 'Invalid Member Namr'
*****************************************************************
Guid gWFid = si.WorkflowClusterPk.ProfileKey;
int idScenario = si.WorkflowClusterPk.ScenarioKey;
int idTime = si.WorkflowClusterPk.TimeKey;
using (DbConnInfoApp dbConnApp = BRApi.Database.CreateApplicationDbConnInfo(si))
{
string strSQL = "SELECT * FROM StageToFinanceValidationError WHERE WorkflowProfileKey=@wfk AND WorkflowScenarioKey=@wsk AND WorkflowTimeKey=@wtk";
List<DbParamInfo> lstParamInfo = new List<DbParamInfo>
{
new DbParamInfo("wfk", gWFid),
new DbParamInfo("wsk", idScenario),
new DbParamInfo("wtk", idTime)
};
using (DataTable dtValErr = BRApi.Database.ExecuteSql(dbConnApp, strSQL, lstParamInfo, false))
{
StringBuilder sb_ValErrorsReport = new StringBuilder();
foreach (DataRow drVal in dtValErr.Rows)
{
string strValMsg = drVal["ValidationmessagesXml"].ToString();
DataCellValidationMsgList validationMsgList = (DataCellValidationMsgList)XmlObject.ReadXmlString(si, typeof(DataCellValidationMsgList), strValMsg, true);
foreach (DataCellValidationMsg err in validationMsgList.Messages)
{
sb_ValErrorsReport.AppendLine(string.Format(err.ErrorMsg, err.StringParams));
}
}
******************************************************************************************