I would normally spend a few days on a project before asking for help, but I’ve been given a fire to put out which has a significant impact on the customer.
On the customer portal, users are able to enter support cases. I need to limit the support cases that show up in the grid to just cases created by the contact that is logged in. Right now, all cases are being displayed for any user. The users are simply contacts for a BAccount “PORTALUSER”. So, when that contact logs in, they see everything for that baccount.
My thought is to somehow change the view on the grid so that it adds a where condition
I cannot seem to find how to get the contactID for that user. I can see that AccessInfo.contactID is a property of AccessInfo, but I don’t know how to get a reference to the “current” of that.
This is how I resolved the issue. I found something similar to this in the Acumatica Training code.
One thing that I had to do is use the UserID of the Contact table in the where clause and compare it to the current logged in userID. For some reason, the ContactID of the AccessInfo was null.
(AccessInfo.contactID.FromCurrent)
I’ll play with pulling the contactID as your code suggests and maybe I can get it that way.
I’ve never done this type of coding in a project before. This works, but feel free to suggest improvements. It seems like I should not have to loop through and execute the query, but just pull a result set and return it. But I guess I have to “yield” each row individually.
public class SPCaseClosedInquiry_Extension : PXGraphExtension<SPCaseClosedInquiry> { protected virtual IEnumerable filteredItems() {
This is how I resolved the issue. I found something similar to this in the Acumatica Training code.
One thing that I had to do is use the UserID of the Contact table in the where clause and compare it to the current logged in userID. For some reason, the ContactID of the AccessInfo was null.
(AccessInfo.contactID.FromCurrent)
I’ll play with pulling the contactID as your code suggests and maybe I can get it that way.
I’ve never done this type of coding in a project before. This works, but feel free to suggest improvements. It seems like I should not have to loop through and execute the query, but just pull a result set and return it. But I guess I have to “yield” each row individually.
public class SPCaseClosedInquiry_Extension : PXGraphExtension<SPCaseClosedInquiry> { protected virtual IEnumerable filteredItems() {
We use 3 different kinds of cookies. You can choose which cookies you want to accept. We need basic cookies to make this site work, therefore these are the minimum you can select. Learn more about our cookies.