This topic is locked

Show different default values on add page based on user

3/16/2020 12:44:12 PM
PHPRunner General questions
B
beishmc author

Hello, i need to show different default value for field based on users, so if user is loged in from different state when adding data in drop down list (lookup table) shows different values for that user.
I have countryID and stateID in users table and also i have those fields in table in which user adding data.
I know how to show data for that user from lookup table based on state and country ID-s but what i need is to set default value on field for users from different countries.

Sergey Kornilov admin 3/17/2020

You can use an event like AfterSuccessfulLogin to retrieve countryID and stateID fields from the users table and save those values in Session variables.
Later you can use those session variables as a default value for any edit control.
More info:

https://xlinesoft.com/phprunner/docs/after_successful_login.htm

https://xlinesoft.com/phprunner/docs/edit_as_settings.htm