How to Create a User Portal?

Hello Five Support Team,

I’m building a sales commission tracking application. The application is almost complete on the Standalone (locally installed) version of the Five platform.

The application’s logic is as follows: The Company gets commissions from deals that sales reps close. The sales reps get commissions from the commissions that the company gets for the closed deals. My application helps to track all the deals, commissions, and payments to the Company and sales reps.

I would like to provide each sales rep with the capability to login to his portal and see his individual performance without seeing the performance of other sales reps.
I don’t want the sales reps to be able to change anything, I just need each sales rep to see the deals that he closed, the commissions that he is entitled to, the payments that he already received, and the total balance with the Company that he currently has.
Only the admin should have the full capabilities to do everything the application allows, including the creation of all sales rep accounts.

I can create all the necessary Queries and Data Views, but I don’t have the roadmap for how to accomplish the described above from A to Z.

Please help me with instructions on how to realize that from the beginning to the end. Please let me know if any additional information is needed.

Thank you! You’ve been doing an AMAZING job!

Vlad

Hello Vladt,

Here is a link to documentation regarding roles within five (4 pages to click through).

You can essentially create an account (role) for each sales rep using the application where you are able to adjust their permissions however you like. In your case, you would set their only permission to ‘read’. Likewise, for admin, you can create an admin role where they are able to do everything.

To allow for the creation and use of roles, you will need to enable Multi User (to manage roles, go to Setup > Roles):

After enabling this, you will notice a new table has been created called iUser where each role you create is stored.

If you would like to filter the data within the application according to which user is logged in at the time, you are able to acquire the user via:

five.currentUserKey();

Where you can then use this to filter the data within the application.

Let me know how you go!
Thanks,
Riley.

Hi Riley,

Thank you for the reply. I had read the “User Roles and Permissions” article in the Five Documentation, but it didn’t give me all the answers I need.

Let me provide more details on what I need to do.

My application has 6 Forms for adding and managing lenders, the Company’s clients, sales reps, deals, and payments. It also has data views, dashboards, and reports (10 in total) for business management purposes.

All of that is intended for the admin only!

Sales reps must NOT see any of it.

The only piece of information each sales rep has to see when he logs in to his account is a special dashboard (or a couple of reports) showing his individual performance. Nothing else.

Is that possible to do? If yes, please show me how. It would be extremely helpful to see an example application.

Also, at the moment, I’m using the standalone (locally installed) version of the Five platform. If the described above is possible to do, can it be done on the local version prior to deploying the application online?

Thank you,

Vlad

Hello Vladt,

SalesRepExample1-20240905-221715841131.fdf (3.0 MB)

Here is an example application of how to create users and roles, I have created a sales rep role and an admin role to illustrate the requirements of your project.

SALES REP DETAILS
Login: Garry
Password: SalesRep123!

ADMIN DETAILS
Login: Polly
Password: admin123!

FIVE ADMIN DETAILS
Login: admin
Password: Five123!
Note: when logging into five admin for the first time in your app, the user name and password is both ‘admin’ where you will then be asked to set a new password.

BREAKDOWN


Within the application, I have created two roles, admin, and salesrep. I have created a menu for each, where salesrep role can only access the ‘SalesRep’ menu, and admin can only access the ‘Admin’ menu. The admin role has been given permissions, create, read, update, and delete whilst the salesrep role has only been given read permissions.

Note: the menu in which you assign to a role must be a parent menu with all other menus attached to it.


You are then able to log into FIVE admin account and create users where you are able to assign a user to a particular role in which you have previously created.

For example, when adding a new sales rep into the team, you would fill in their details and assign them to the role of sales rep.


You will also need to ensure that the iUserKey from the iUser table has been implemented as a foreign within the tables you wish to filter according to which user is logged in.

Note: If your application already has user data, you will need to manually update this data so that it corresponds to the iUserKey (using a MySQL UPDATE Statement).

With the iUserKey being in the other tables, forms within your application will be automatically filtered according to which user is logged in, however, if using queries within your application for things like data views, you will need to filter the query using the currently logged in user.


This is an example of the query I have used within my application which uses the currently logged in user key to filter the output.

SUMMARY
When you use my application, you will be able to see how the menus and content within them adjust depending which user you logged in with. You will see with admin (Polly), it shows all data for all sales reps, however, with Garry the sales rep, it only shows data related to him. You will also see that Polly can modify the data whilst Garry can only read it.

I hope this helps,
Let me know if there is any issues,

Thanks,
Riley.

1 Like

Sorry Vladt,

Forgot to answer your last question.

‘Also, at the moment, I’m using the standalone (locally installed) version of the Five platform. If the described above is possible to do, can it be done on the local version prior to deploying the application online?’

Yes it can be, the fdf I attached was done within my local version, just make sure you have switched the Multi User switch to ‘On’ for your application,

Thanks,
Riley.

1 Like