I've been scratching my head a couple of days on this one.
As we're migrating to AlphaFive V11, and keeping from redesigning our database structures, this may be the cause of the problem. Though i can't figure out why its a problem.
Initially i was like "Oh fantastic, i can create and edit users with these dialogs... no coding yay!"
So here goes...
In our current database. There are two tables. [Agent], [Logon].
[Agent] Stores stuff like Name, Address, Company, Contact Details, etc...
[Logon] Stores UserName, Password, FK_Agent
The [Logon] table linked with the [Agent] table 1 to 1, but not all Agents have, let alone need, Logons.
Agents may require both the removal or addition of a single logon link, depending on whether there is a request to give them their own logon or if their Administrator is taking over their use of our product.
So far this all works in regard to visibility, security and permissions with dozens of companies, an admin or two for each company, hundreds of agents, and of course website administrator controls.
What doesn't work is how i'm trying to setup the page.
Naturally, I have a page for Website Admins setup where [Agent] details can be edited, with search, grid, and detail view parts.
The SQL is: [Agent] Left Join [Logon] On [Agent].PK_Agent = [Logon].FK_Agent
The grid displays - [Agent].FirstName,.LastName,.Company,.Logon
Detail view displays - All fields from [Agent] to be edited (this updates/adds new just fine)
However on the grid part I have control links (with conditional visibility) to edit/create logons, which open a popup to edit/create new user from dialogs (Create from the provided templates)
I've tried both Open Dialog, and Edit existing row as actions for the onclick event of the links - Populating the controls on primarykey [Logon].UserName from the grid for dialog, doesn't seem to be an option for Edit existing row for this :/
On the dialogs: Binding only UserName and Password controls to the corresponding fields in [Logon]. Set to updateable in the control properties
Using UserName as primary key for the dialog as suggested.
Now i could use PK_Logon as the ulink, which i did during evaluation of the product, and keep UserName out of the PrimaryKey, however, with the upcomming move to IIS, i'm going to avoid doing that.
The popups display correctly for the Grid Row (an Agent) that i click the edit logons link for.
This all works except for displaying a selected UserRole on Logins that already have their Security Group Set.
Tried everything from passing in and using session variables to other variable types to display the select value using the selected value property, to no avail. It just complains that variables cannot be found. So i'm stumped there.
What main problem i'm getting editing the record is "UserName must be unique" when i save. I'm like "what the heck? i'm updating, not inserting", I didn't even edit that field with only edited fields update set to true. But i would like the ability to edit the UserName.
So i can't even simply update the Logon table from these dialogs upon removing the relevant code in the events.
I'm close to just building my own HTML form that pops-up and populates along the UserName session variables, with own A5 scripts called on submit to insert/update table records and the Alpha web security. At this stage it just seems a heck of alot easier and makes simpler sense in my head.
Hope this is making sense. This is a terribly long explanation, but i also hope someone may have some suggestions.
The tutorial videos D_SF_1 to D_SF_5 have also been no help, there the UserRoles selected value appears to have automatically worked. Also, according to the videos, Using the UserName as PrimaryKey works just fine.
I also get an error about needing to enter confirm password, when on the videos he saves without even filling that field. I want some validation, but only on those that are changed... i assumed that checkbox would have worked in that instance.
I've tried using different variable types that i've passed over for the LoadUser script in the OnDialogInitialize event to see if the issue lay there, but that didn't affect the errors i was getting.
I'm definately doing something wrong, been stuffing around with this too long that i feel i'm totally missing something right in front of me.
arghh help!
Might be that i just need to use a Logon only grid and Edit Current Record popup on a seperate page, though I cannot see why. And would like to reduce the amount of screens needed for relational data where i possibly can. (which so far, has been the beauty of Alpha Five and its Security Framework with very little hand coding)
As we're migrating to AlphaFive V11, and keeping from redesigning our database structures, this may be the cause of the problem. Though i can't figure out why its a problem.
Initially i was like "Oh fantastic, i can create and edit users with these dialogs... no coding yay!"
So here goes...
In our current database. There are two tables. [Agent], [Logon].
[Agent] Stores stuff like Name, Address, Company, Contact Details, etc...
[Logon] Stores UserName, Password, FK_Agent
The [Logon] table linked with the [Agent] table 1 to 1, but not all Agents have, let alone need, Logons.
Agents may require both the removal or addition of a single logon link, depending on whether there is a request to give them their own logon or if their Administrator is taking over their use of our product.
So far this all works in regard to visibility, security and permissions with dozens of companies, an admin or two for each company, hundreds of agents, and of course website administrator controls.
What doesn't work is how i'm trying to setup the page.
Naturally, I have a page for Website Admins setup where [Agent] details can be edited, with search, grid, and detail view parts.
The SQL is: [Agent] Left Join [Logon] On [Agent].PK_Agent = [Logon].FK_Agent
The grid displays - [Agent].FirstName,.LastName,.Company,.Logon
Detail view displays - All fields from [Agent] to be edited (this updates/adds new just fine)
However on the grid part I have control links (with conditional visibility) to edit/create logons, which open a popup to edit/create new user from dialogs (Create from the provided templates)
I've tried both Open Dialog, and Edit existing row as actions for the onclick event of the links - Populating the controls on primarykey [Logon].UserName from the grid for dialog, doesn't seem to be an option for Edit existing row for this :/
On the dialogs: Binding only UserName and Password controls to the corresponding fields in [Logon]. Set to updateable in the control properties
Using UserName as primary key for the dialog as suggested.
Now i could use PK_Logon as the ulink, which i did during evaluation of the product, and keep UserName out of the PrimaryKey, however, with the upcomming move to IIS, i'm going to avoid doing that.
The popups display correctly for the Grid Row (an Agent) that i click the edit logons link for.
This all works except for displaying a selected UserRole on Logins that already have their Security Group Set.
Tried everything from passing in and using session variables to other variable types to display the select value using the selected value property, to no avail. It just complains that variables cannot be found. So i'm stumped there.
What main problem i'm getting editing the record is "UserName must be unique" when i save. I'm like "what the heck? i'm updating, not inserting", I didn't even edit that field with only edited fields update set to true. But i would like the ability to edit the UserName.
So i can't even simply update the Logon table from these dialogs upon removing the relevant code in the events.
I'm close to just building my own HTML form that pops-up and populates along the UserName session variables, with own A5 scripts called on submit to insert/update table records and the Alpha web security. At this stage it just seems a heck of alot easier and makes simpler sense in my head.
Hope this is making sense. This is a terribly long explanation, but i also hope someone may have some suggestions.
The tutorial videos D_SF_1 to D_SF_5 have also been no help, there the UserRoles selected value appears to have automatically worked. Also, according to the videos, Using the UserName as PrimaryKey works just fine.
I also get an error about needing to enter confirm password, when on the videos he saves without even filling that field. I want some validation, but only on those that are changed... i assumed that checkbox would have worked in that instance.
I've tried using different variable types that i've passed over for the LoadUser script in the OnDialogInitialize event to see if the issue lay there, but that didn't affect the errors i was getting.
I'm definately doing something wrong, been stuffing around with this too long that i feel i'm totally missing something right in front of me.
arghh help!
Might be that i just need to use a Logon only grid and Edit Current Record popup on a seperate page, though I cannot see why. And would like to reduce the amount of screens needed for relational data where i possibly can. (which so far, has been the beauty of Alpha Five and its Security Framework with very little hand coding)
Comment