Return user’s company using the matricula

Asked

Viewed 65 times

0

I am developing a web application integrated with Protheus.

The issue is that there are several companies registered in Protheus, and I need to know which company/ affiliate the user belongs, and all I ask him to inform in the authentication of the web application is user and password.

My question is whether it is possible to return the company to which the user belongs only by registration, or whether it is better to ask at the time of authentication to which company the user intends to log in.

Thank you!

2 answers

0

Can you work on the base code? If yes, you can try using Join.
Type:

select nome from tbl_empresa e join tbl_usuario u on u.empresa_id = e.id;


Replacing, of course, the table names.
Otherwise, if you don’t have access, tell me and I’ll take another look.

  • Hi Bianca, as the query is quiet, the question is that I do not know if it is possible in Protheus to return the user’s company through the registration.

0

I was able to solve my problem by adding a select on the authentication page by reading the SM0 table, where I can return the registered companies, now I know which company the user belongs to when authenticating, thanks for the help!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.