Hello!
I am currently building a simple PowerPages application where I will have users from multiple different companies log in and send forms, or wishes in this case, of other companies they would like to meet during a trip.
I have my users in the Contact table, and every contact is connected to a company through the "Name of organization" column.
When they log in and send a form with a wish, I have a hidden text field that is prefilled with "Site visitor profile data" > "Name of organization". That way, the name of the organization that the user is connected to gets sent to my "Wishes" table.
Now, I have a list on my page that displays the records from the "Wishes" table.
The main question I have, is how can I add a default filter or view that only displays the records where "Name of organization" is the same as the name of the organization connected to the current logged in user?
I know I can get the name of the organization using {{ user.adx_organizationname }}, but I have not been able to implement that into a view or filter.
Anyone have an idea?
I think my problem stems from the fact that my "Account" lookup on the Contact form is not working properly, and only displays other contacts in that lookup, even though the account table is full of records. This stopped me from being able to connect a contact to an account, and that is why the permission par that @Rupinder suggested did not work for me.
As this is a temporary page either way, I let each company have one main user, and display the records connected to the logged in user instead.
I think if my Account field on contacts wasn't broken, this would've worked really well.
First you need to resolve the text field that is holding the company. For the security model to work you need this to be a Lookup (not text) to Account. If your portal users are already associated with the Account record when they make the first form submission, you can use JavaScript/JQuery or Form Metadata to populate the account (my preference is always a metadata record, but may not be suitable for some scenarios).
If your portal user is not already linked to the account and they are typing in random text, then you will either need to resolve that Text to or create an Account record based on it, depending on your scenario this would be via a Plugin, Workflow, Flow, or if it is suitable for your scenario the portals Web API.
Hi,
I have implemented something similar using the following tutorial. I have Account table which holds information about the companies. Then I have contacts which are associated to individual companies. Account - Contact (many-to-one) relationship. The setup table permissions > Access type "Account access" on the table where account information is held, in my case Jobs in the screenshot below. I hope helps.
Tutorial: Display data securely on your site | Microsoft Learn