Chris_J Posted April 8, 2008 Share Posted April 8, 2008 I ma having some trouble scripting this one. I have a layout called Lecturers, and a privilege set called Lecturers. What I would like to happen is, when one of the lecturers logs in to the database, I'd like them to go to the record related to them, as it has their course schedule. Problem is, I did a set field to Get (AccountName) and it works, but if someone else is logged in too, it takes me to that person rather than myself or it does something strange to that effect. I now have this at login IF Get (privilegesetname) = "Lecturers" Perform Script (Go to Lecturers) What would I put here to go to Joe Bloggs if he is logging in, even if John Smith is logged in Else Perform Script (which goes to contacts) End if I hope this kind of makes sense smiley-tongue-out Link to comment Share on other sites More sharing options...
David Head Posted April 9, 2008 Share Posted April 9, 2008 I am assuming two things here: 1. every lecturer has their own account name and password (attached to the Lecturers privilege set) 2. there is some way (field value) to identify the record you want to display for any user Given the above is true, you would have a script along the lines of: If [ Get ( PrivilegeSetName ) = "Lecturers" ] Go to Layout ["Lecturers" (Lecturer)] Enter Find Mode [ ] Set Field [Lecturer::lecturername; Get ( AccountName )] Perform Find [ ] Else Whatever... End If Note that you would probably also want to trap for what happens if there is no lecturer record found. Link to comment Share on other sites More sharing options...
Chris_J Posted April 9, 2008 Author Share Posted April 9, 2008 No 1 is certainly true. I'm unsure what you mean by an identifier in No 2. I've done the set field, but it's overwriting a record with my login account name, or creating a new record. Link to comment Share on other sites More sharing options...
Chris_J Posted April 9, 2008 Author Share Posted April 9, 2008 It helps if I put Enter Find Mode before Set Field doesn't it smiley-laughing smiley-tongue-out Never Mind! Link to comment Share on other sites More sharing options...
Chris_J Posted April 9, 2008 Author Share Posted April 9, 2008 Doesn't work very well on IWP though. Link to comment Share on other sites More sharing options...
Chris_J Posted April 9, 2008 Author Share Posted April 9, 2008 Scrap that, I had an incompatible script step at the beginning of the script. Maxmimize Window. Link to comment Share on other sites More sharing options...
David Head Posted April 10, 2008 Share Posted April 10, 2008 Doesn't work very well on IWP though. For any solution, IWP has some specific requirements. In this case, the problem was not with the solution provided but with other script steps. Big tip for all posters - if you are using IWP, state that in your original question. From an unpaid support point of view it is very frustrating to find out about that requirement later. From your point of view, you may get answers that just don't work and that wastes everyone's time. Link to comment Share on other sites More sharing options...
Chris_J Posted April 10, 2008 Author Share Posted April 10, 2008 I'll consider my hands slapped but what you posted worked on IWP too, it was my own mistake putting adjust window script step. Link to comment Share on other sites More sharing options...
Recommended Posts