示例#1
0
 private static void SetWarningIfNeeded <TField>(PXCache cache, object row, string message,
                                                 bool doesAnyOutstandingComplianceExist, PXErrorLevel errorLevel = PXErrorLevel.Warning)
     where TField : IBqlField
 {
     if (doesAnyOutstandingComplianceExist)
     {
         cache.RaiseException <TField>(row, message, errorLevel: errorLevel);
     }
     else
     {
         cache.ClearFieldErrorIfExists <TField>(row, message);
     }
 }
 private static void RaiseOrClearExceptionForRelatedField <TField>(
     PXCache cache, object entity, bool validationErrorNeeded, PXErrorLevel errorLevel)
     where TField : IBqlField
 {
     if (validationErrorNeeded)
     {
         RaiseCorrectExceptionForRelatedField <TField>(
             cache, entity, ComplianceMessages.ExpiredComplianceMessage, errorLevel);
     }
     else
     {
         cache.ClearFieldErrorIfExists <TField>(entity, ComplianceMessages.ExpiredComplianceMessage);
     }
 }