@vibindas
Here is what I found out after spending a couple of days deep diving into the Acumatica code of the Portal.
First, this obviously not a GI – it is an Inquiry graph/Creen called SPCaseClosedInquiry
The Query is below
I think the issue is that the LastActivity field comes from the CRActivityStatus DAC – and that DAC is not included in the select for this Inquiry
I could just over-ride the base query to join in that table. But that would require a specific customization; whereas this is a “bug”, IMHO in Acumatica’s base code. (I do not know how to report this to Acumatica as a bug though.)
Note – there are some internal PXData functions being used to ensure that the logged in User only sees their own cases (MatchWithBaccountNotNull and OwnerFilter)
public SelectFrom<CRCase>
.LeftJoin<CRCaseClass>
.On<CRCaseClass.caseClassID.IsEqual<CRCase.caseClassID>>
.LeftJoin<Contract>
.On<Contract.contractID.IsEqual<CRCase.contractID>>
.LeftJoin<BAccount>
.On<BAccount.bAccountID.IsEqual<CRCase.customerID>>
.LeftJoin<CRCustomerClass>
.On<CRCustomerClass.cRCustomerClassID.IsEqual<BAccount.classID>>
.LeftJoin<Contact2>
.On<CRCase.ownerID.IsEqual<Contact2.contactID>>
.LeftJoin<Contact>
.On<CRCase.contactID.IsEqual<Contact.contactID>>
.LeftJoin<CRContactClass>
.On<CRContactClass.classID.IsEqual<Contact.classID>>
.Where<Brackets<MatchWithBAccountNotNull<CRCase.customerID>>
.And<CRCase.isActive.IsEqual<False>>
.And<Brackets<CRCaseClass.isInternal.IsEqual<False>
.Or<CRCaseClass.isInternal.IsNull>>>
.And<Brackets<CRCustomerClass.isInternal.IsEqual<False>
.Or<CRCustomerClass.isInternal.IsNull>>>
.And<Brackets<CRContactClass.isInternal.IsEqual<False>
.Or<CRContactClass.isInternal.IsNull>>>
.And<Brackets<OwnerFilter.contractID.FromCurrent.IsNull
.Or<CRCase.contractID.IsEqual<OwnerFilter.contractID.FromCurrent>>>>
.And<Brackets<OwnerFilter.currentOwnerID.FromCurrent.IsNull
.Or<CRCase.contactID.IsEqual<OwnerFilter.currentOwnerID.FromCurrent>>>>>
.View
FilteredItems;