Help with a report script
I have a report script that starts with opening a layout to select a date range.
Once a date range is selected they pick a Company (one of our clients)
It processes a query and sums up some information.
The issue I have is I need to modify this based on the user that is logged in. For the time being I'm ok with hard coding this into the report script. It's just one employee (contractor) that needs this filtered.
Would it be best to break the script into three parts or a really big IF statement?
Solution A: I start the script by checking the username logged in. IF it equals my contractor then go to contractor_script which then only looks up client groups where our field called AcctMgr matches the contractor's last name and only those are displayed. Else go to my old script.
Solution B: Wrap the current script into an IF statement. IF the username equals my contractor set a global variable based on where the contractor's last name matches the last name of our AcctMgr field that manages that client. Else set the global variable to what it is now, all the client records.
A more permanent solution would be to tie users to the group table and only let them see information for their clients only via a relationship or lookup throughout ALL the layouts. That would be a pretty massive change that I'm not comfortable with until I finish the filemaker pro 12 training book.
I'm new to FM, like it so far. Can't wait to get into the web publishing part.
Want to say thanks in advance for anyone that give me some guidance. We're in a pinch and I've become THE db guy.