0

I'm working on customizing the landing page in our company's Acumatica Customer Portal by using a Wiki page, and I need to modify the displayed HTML elements based on the user's role, as well as write the user's name into one of the HTML elements.

What I'm trying to find, is a way to make an Acumatica function call maybe using Javascript, that returns the user's name and role, or maybe an API call I could make to get the same information.

What I've found / tried

I found that there's a function that returns the user name in this post, and I've tried to find ways to run it from Javascript, when the landing page loads, but haven't been able to make it work.

I also found that I can make API calls to Acumatica, and it gives a lot of options to retrieve production related data, but apparently none of the available endpoints directs to the current user's profile (which is screen SP408045 in the portal).

Thanks in advance for your help

1 Answers1

1

There can be multiple users logged in at the same time.

System Monitor page lists logged in users: enter image description here

An API call couldn't figure out which user you want.

With JavaScript you can try Cross Site scripting and parse the HTML element to find the logged-in user and roles. On Acumatica side the editor control values can be read with px_alls global javascript object. In both cases the logged-in user information must be present in the page. This means the pages have to be customized to add those elements. They can be hidden from UI but must be present in HTML source.

Hugues Beauséjour
  • 8,067
  • 1
  • 9
  • 22
  • Hi Hugues. Thanks for your answer. Could you please provide an example of how I could use px_alls with javascript? Or maybe direct me to some reference document about how to use px_alls? – Jorge Chávez Apr 21 '21 at 23:30
  • Install Acumatica website locally and search ASPX files in Pages directory for 'px_alls'. You can do Open->Website in Visual Studio (admin) or use other search app like Notepad++ – Hugues Beauséjour Apr 22 '21 at 04:16