操作服务插件如何判断当前单据是否存在下游单据?
private class OperValidator : AbstractValidator
{
public override void Validate(Kingdee.BOS.Core.ExtendedDataEntity[] dataEntities, ValidateContext validateContext, Kingdee.BOS.Context ctx)
{
//load当前单据meta信息
FormMetadata meta = MetaDataServiceHelper.Load(this.Context, "Esy_IntlogisticsTransporDocument") as FormMetadata;
foreach (var dataEntity in dataEntities)
{
var entity = dataEntity.DataEntity;
//IsPushArgs
//BusinessInfo:meta.BusinessInfo
//entityKey:需要判断的单据体标识
//activeRow:当前明细行数据包
IsPushArgs isPushArgs = new IsPushArgs(meta.BusinessInfo, "FEntity", entity);
var isPush = Kingdee.BOS.ServiceHelper.BusinessFlowDataServiceHelper.IsPush(ctx, isPushArgs);
if (isPush)
{
ValidationErrorInfo ValidationErrorInfo = new ValidationErrorInfo(
string.Empty,
dataEntity["Id"].ToString(),
dataEntity.DataEntityIndex,
dataEntity.RowIndex,
dataEntity["Id"].ToString(),
"该行存在下游数据,无法进行反关闭",
"错误");
validateContext.AddError(null, ValidationErrorInfo);
continue;
}
else
{
}
}
}
}
操作服务插件如何判断当前单据是否存在下游单据?
本文2024-09-16 17:10:27发表“云星空知识”栏目。
本文链接:https://wenku.my7c.com/article/kingdee-k3cloud-14003.html