It would seem that this is for changing from one view to another with static data - my scenario is that I have 41 users that need to complete the form. They need to complete 14 fields on a line and save it.
I am proposing 41 views for them of several lines each (not much screen rendering).
I wanted to detect the UserName and from that switch to one of the 41 views, as initially mentioned I can set a field value to detect the UserName but can not get the code to trigger in the onload event (my bad programming no doubt).
Any ideas in theory should be simple if only I knew the syntax (some sample code would help me sleep at night)!
So my thoughts are:
Detect the UserName and if it equals a view in our instance Admin-location so they are Admin-Longreach etc. Once it detects this switch to that view onload.
If not equal to any of the 41 views then display the default (full page view).....sounds simple eh!
Help again!
I have been trying to use this simple peice of code in the onload section but to no avail - any idea's?
switch (System.Environment.UserName)
{
case "Administrator": XDocument.View.SwitchView("Cornetts Group View");
case "Admin-Banksia": XDocument.View.SwitchView("Admin-Banksia");
case "Admin-Longreach": XDocument.View.SwitchView("Admin-Longreach");
}
}
Thanks
Carl