In my code I’m looking to see if an invoice already exists before proceeding. I was using this query:
ARRegister invoice =
PXSelect<ARRegister,
Where<ARRegister.docType, Equal<Required<ARRegister.docType>>,
And<ARRegister.refNbr, Equal<Required<ARRegister.refNbr>>>>>.
Select(this, receiptRow.ApplyToDocType, receiptRow.InvNbr);
But it would not find the record. I confirmed that it is in the ARRegister table (local install, local database).
So I decided to try this:
ARInvoice invoice = SelectFrom<ARInvoice>.
Where<ARInvoice.docType.IsEqual<@P.AsString>.
And<ARInvoice.refNbr.IsEqual<@P.AsString>>>.
View.
Select(this, receiptRow.ApplyToDocType, receiptRow.InvNbr);
and that worked. It is a different table but the primary keys on both tables are the same.
So, my question is, what’s the difference between the PXSelect and the SelectFrom calls?
In case it matters ‘this’ is within an Action button on a custom screen (custom graph showing records from a custom DAC).