October 26, 201015 yr Hi, I have a table with 2 fields (sales rep 1 and sales rep 1). Now what I want to do is when a sales rep logs in, he only sees his sales when he is listed as sales 1 OR sales 2. Now I noticed that in the script editor when you use a perform find / enter find mode and specify there that is shows Field Criteria a =d AND b =c so is there a way to work with an OR ?
October 26, 201015 yr Yes, New Request. Each request is an OR. However, it would be better to not use two fields, but rather two related records. If the parent record is a Sales record, then the child table would be SalesRefs. This table would contain at least the parent SalesID and a RefID (perhaps using StaffIDs from a Staff table). If you want a user to only view the Sales for which he is listed as one of the Refs, then you need to use a record level access rule. If you create a calc field in Sales, Refs_c = List (sales_SALESREFS::_kF_RefID) result text, and set the view access to allow viewing when the user's ID is one of the IDs in the Refs_c field. The rla calc would be: Patterncount ( Refs_c; gUserID ) Set gUserID in an Open script. I'm not sure you'll follow this completely, so pls reply with questions. This is a very standard technique.
October 27, 201015 yr @bcooney. I am a novice and am interested in the original poster's question. I too am considering providing a view based on user. Can it be as simple as using the security setting I already use for login, and based on account, have the database display only records entered by that user? The Get(AccountName) is the easy part for me, already using that to set some default autofills. Would it then be a sort on user on entry into any layout? Sounds easy enough, always does... it is between the thought in my mind and the keyboard where the problem typically occurs. Thanks
October 27, 201015 yr BBud, This is called record level access and is the use of FM's Security feature. See here: http://fmforums.com/forum/showtopic.php?tid/198109
Create an account or sign in to comment