5.1 MVC Issue with View Parameters being passed to webpage by hyperlink

This forum allows users to post and respond to "How Do I Do ....." questions. The information contained in this forum has not been validated by K-Rise Systems and, as such, K-Rise Systems cannot guarantee the accuracy of the information.
Post Reply
mollydunn
Posts: 26
Joined: April 7th, 2022, 4:17 pm
Contact:

5.1 MVC Issue with View Parameters being passed to webpage by hyperlink

Unread post by mollydunn »

I ran into an issue where on a webpage, WorkWithAccounts, that shows a list of all accounts, where each row contains a hyperlink to the AccountHome webpage. I needed to pass in the ViewParameters so that when the user clicked on the link, it took them to the correct AccountHome page and not just their own. I was having an issue where when any AccountHome link was clicked, it forwarded to the AccountPage for the user who was currently logged in. I was able to solve the issue by changing the parameter property values, and clearing the filters I was using for my search. I am now reapplying the filters to be sure it functions properly with the search filters, but in the meantime here are the corrected parameters that allowed the link to work properly on my page.

The parameters set for the hyperlink properties on the WorkWithAccounts webpage canvas:
image.png
The parameters for a submethod in the model for the AccountHome webpage:
image.png
word count: 163

Tags:
CathyC
Posts: 469
Joined: November 16th, 2021, 11:15 am
Contact:

Re: 5.1 MVC Issue with View Parameters being passed to webpage by hyperlink

Unread post by CathyC »

This is a feature of EASYCommerce which should be similar in other implementations.

The features is:
  • When loading the page with a query string for a specific account, load the info for that account
  • When loading the page with no given query string, load for the logged in user's web account based on their user session variables
The issue was that an admin could load the admin page "Work with Accounts" and when they clicked into one of the accounts to go to the "Account Home", the query string would not be passed along. So the account home page opened and hit the case where no query string was given. So it loaded for the admin's web account and showed the internal account instead of the account the admin clicked on.

The fix Molly described accomplishes the intended functionality of the feature.
word count: 144
Post Reply