private void ValidateAnswer(PXCache cache, PXRowPersistingEventArgs arguments) { if (arguments.Row is CSAnswers answer && (arguments.Operation == PXDBOperation.Insert || arguments.Operation == PXDBOperation.Update)) { var group = attributeGroups.Search <CSAttributeGroup.attributeID>(answer.AttributeID) .FirstTableItems.Single(); if (group.Required.GetValueOrDefault() && string.IsNullOrEmpty(answer.Value)) { RaiseExceptionForEmptyAttributeValue(answer); } } }
private CSAnswers GetAnswer(string attributeId, object document) { var noteId = entityHelper.GetEntityNoteID(document); return(answers.Search <CSAnswers.attributeID, CSAnswers.refNoteID>(attributeId, noteId)); }
private void UpdatePayment(PXSelectBase <APPayment> paymentView, IDocumentKey payment) { var resultPayment = (APPayment)paymentView .Search <APPayment.docType, APPayment.refNbr>(payment.DocType, payment.RefNbr); if (resultPayment != null) { resultPayment.Selected = true; paymentView.Cache.Update(resultPayment); } }