I'm trying to create a processing screen with a filter containing an Email Account selector and a grid below showing incoming emails for the selected account.
Initially I tried using a PXProcessingJoin directly on CRSMEmail:
public PXProcessingJoin<CRSMEmail,
LeftJoin<BZPODocument, On<BZPODocument.messageID, Equal<CRSMEmail.messageId>>>,
Where<CRSMEmail.mailAccountID, Equal<Current<EMailAccount.emailAccountID>>,
And<CRSMEmail.isIncome, Equal<True>,
And<BZPODocument.messageID, IsNull>>>>
Emails;When I set grid's DataMember to this view, I got the following error:
An unhandled exception has occurred in the function 'get_Item'. Please see the trace log for more details.
undefined: Cannot read properties of null (reading 'elemByID')I then switched to using a PXProjection DAC based on CRSMEmail:
[PXProjection(typeof(Select2<CRSMEmail,
LeftJoin<BZPODocument, On<BZPODocument.messageID, Equal<CRSMEmail.messageId>>>, Where<CRSMEmail.isIncome, Equal<True>, And<BZPODocument.messageID, IsNull>> >))]
public class BZCRSMEmail : PXBqlTable
{
...
}and changed the view to:
public PXFilter<BZEmailFilter> Filter;
[PXFilterable]
public PXProcessing<BZCRSMEmail,
Where<BZCRSMEmail.mailAccountID,
Equal<Current<BZEmailFilter.emailAccountID>>>>
Emails;Now the original error is gone, but the screen throws Object reference
I have already tried:
- changing key fields in the projection
- removing joins
- using different key combinations
but the Object Reference exception remains.
Am I missing something?