Hello gang,
I have the below select in one of my methods. When there is data that meets the conditions, it works fine but when there is no data with this conditions I get an error “Sequence contains no element”. How can I prevent system from raising error. I’m checking this select result later in my code whether is null or not.
EPApproval ownerApproval = PXSelect<EPApproval,
Where<EPApproval.refNoteID, Equal<Required<APInvoice.noteID>>,
And<EPApproval.ownerID, Equal<Required<AccessInfo.contactID>>,
And<EPApproval.status, Equal<EPStatuses.pending>>>>,
OrderBy<Asc<EPApproval.approvalID>>>
.Select(this.Base, this.Base.Document.Current.NoteID, PXAccess.GetContactID().Value, EPStatuses.Pending).First();