有些业务需求中需要在当前单据调用其他单据的操作服务,而且调用操作服务之后需要将对应的异常及操作校验信息反馈到当前单据上,如下描述怎么实现(比如当前单据审核后,需要调用下游单据的提交、审核等操作):
调用操作服务后,会得到一个IOperationResult,处理其中的异常信息、校验信息。
[code]public class Audit : AbstractOperationServicePlugIn
{
public override void EndOperationTransaction(Kingdee.BOS.Core.DynamicForm.PlugIn.Args.EndOperationTransactionArgs e)
{
base.EndOperationTransaction(e);
DynamicObject[] dataEntitys = e.DataEntitys;
List
private string ErrorMessage(IOperationResult oresult)
{
StringBuilder stringBuilder = new StringBuilder();
foreach (OperateResult current in oresult.OperateResult)
{
stringBuilder.AppendLine(current.Message);
}
foreach (ValidationErrorInfo current2 in oresult.ValidationErrors)
{
stringBuilder.AppendLine(current2.Message);
}
return stringBuilder.ToString();
}
}[/code]