Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Wednesday, August 27, 2025 
 
slxdeveloper.com Community Forums  
   
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
 Architect Forums - SalesLogix Scripting & Customization
Forum to discuss writing script in Architect plugins for SalesLogix & general SalesLogix customization topics (for Windows client only). View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to SalesLogix Scripting & Customization | New ThreadView:  Search:  
 Author  Thread: Access to Field Level security information
Belinda Zenk
Posts: 8
 
Access to Field Level security informationYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 09 Feb 09 12:08 PM
Hey all!

I need to make certain fields R/W or R/O based on FLS AND Factors within the data... ie. An account with an external account number is RO to everybody and without an external account number I want the fields to revert to FLS. If I program the change in the OnChange event, the R/O part works fine, but the fields that are R/O for some are being set to R/W for everybody... How do I check FLS before I revert these fields to R/W?
[Reply][Quote]
Bob (RJ)Ledger
Posts: 1103
Top 10 forum poster: 1103 posts
 
Re: Access to Field Level security informationYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 10 Feb 09 7:13 AM
The changing of state (R?W, R/O, N/A) of a field under FLS does not have late binding (run-time) capability. It is strictly early binding (design time).. Actually design time at teh time you setup teh SecProfiles and assign them.

All you need to do is set the (bound) text control ReadOnly property true/false on an AXFormChange..
ex:
If trim("" & txtTextControl.Text) = "" Then
txtTextControl.ReadOnly = True
Else
txtTextControl.ReadOnly = False
End If
--
RJLedger - www.rjlSystems.net
[Reply][Quote]
RJ Samp
Posts: 973
Top 10 forum poster: 973 posts
 
Re: Access to Field Level security informationYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 10 Feb 09 8:52 AM
Doesn't work that way on the fly......it's based on SECCODEID/Team and the user's FLS profile for that team BEFORE you get the data and return it to the database......so FLS is invoked before you the developer gain control over the account detail view.....

what we do is walk all control's in the collection and set them to readonly, etc. based on the Account Number (or whatever).....during the AXFormChange.....we don't use FLS.
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: Access to Field Level security informationYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 10 Feb 09 10:20 AM
You can see the FLS for a given user by using the fx_rowaccess OLEDB function. You basically do a query, and include the field you want to check as well as include the fx_rowaccess() function in the query and it will return a byte array, indicating the access level for each field in the query. Then you will know whether the current user has RO, RW, or NO access to the field.

You can see more about that here: http://www.slxdeveloper.com/forum.aspx?forumid=2002&postid=471#471

-Ryan
[Reply][Quote]
Belinda Zenk
Posts: 8
 
Re: Access to Field Level security informationYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 10 Feb 09 12:00 PM
Thanks, eveyone!!!

This is exactly what I needed!!!

Most likely I will be writting code to use this in my application... if I end up with anything I think might be useful, I will post it here!

Thanks, again!
[Reply][Quote]
RJ Samp
Posts: 973
Top 10 forum poster: 973 posts
 
Re: Access to Field Level security informationYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 11 Feb 09 9:25 AM
''''''''
Sub GeneralForms_Security(TheFormPermission)
'''' Every ActiveX Form is in the Forms Collection.
'''' Each Form has a Controls Collection of all controls on that form.
'''' this routine sets control properties by control type to allow/block data entry/user interaction
'''' TheFormPermission Parameter can either be Read Write ("RW") or Read Only ("RO") at this time.
'''' Data Grids, List Views, Panels, Buttons, and other 'speciality' controls MOST LIKELY will need additional scripts to handle
'''' that specific control on that specific form.

DefaultReadOnlyColor = wclLightGray

If TheFormPermission = "RW" OR TRIM(application.basicfunctions.CurrentUserID) = "ADMIN" then
g_UserPermission = "RW"
KONTROL = FALSE
KONTROL_OPP = TRUE
TheControlColor = Application.BasicFunctions.StringToColor("Window")
ELSE
KONTROL = TRUE
KONTROL_OPP = FALSE
TheControlColor = DefaultReadOnlyColor
END IF

For iControl = 0 To ControlCount - 1
Select Case (TypeName(Controls(iControl)))
Case "Edit","Memo"
Controls(iControl).ReadOnly = KONTROL
Controls(iControl).Color = TheControlColor

Case "PickList", "NameEdit"
Controls(iControl).ButtonVisible = KONTROL_OPP
Controls(iControl).ReadOnly = KONTROL
Controls(iControl).Color = TheControlColor

Case "CheckBox"
Controls(iControl).Enabled = KONTROL_OPP

Case "ComboBox"
Controls(iControl).Enabled = KONTROL_OPP
Controls(iControl).Color = TheControlColor

Case "LookupEdit","DateTimeEdit"
Controls(iControl).ReadOnly = KONTROL
Controls(iControl).ButtonVisible = KONTROL_OPP
Controls(iControl).Color = TheControlColor

Case "PopupEdit"
Controls(iControl).ReadOnly = KONTROL
Controls(iControl).Color = TheControlColor

CASE "LinkEdit"
Controls(iControl).ReadOnly = KONTROL
Controls(iControl).Color = TheControlColor

Case "Button"
' Do Nothing

Case "DataGrid"
' Do Nothing

Case "Label"
' Do Nothing

Case "Panel"
' Do Nothing

Case "RadioGroup"
' Do Nothing

Case Else
' Do Nothing
End Select
Next
Call ErrorCheckSLX("SetFormSecurity Failed",0,"Form Level Security")
End Sub
[Reply][Quote]
Belinda Zenk
Posts: 8
 
Re: Access to Field Level security informationYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 13 Feb 09 4:34 PM
Ok... It took me a while to translate fx_rowaccess into something I could use... so I thought I would pass it on.

It's a little function to return the FLS of a field:

Function FieldAccess(strTable, strField, strIDFieldName, strID)
Dim intFLS
Dim objSLXDB, objRS, strSQL, arFLS

Set objSLXDB = new SLX_DB
on error resume next
Set objRS = objSLXDB.GetNewRecordset
strSQL = "Select " + strField + ", fx_rowaccess() as FLSAccess From " + strTable + " Where " + strIDFieldName + " = '" & strID & "'" 'DNL
'strSQL = "select MemberValue, fx_rowaccess() as FLSAccess from account_2 where accountid = 'A6UJ9A000032'"
objRS.Open strSQL, objSLXDB.Connection

FieldAccess = "Unknown"
if not(objRS.eof) then
reDim arFLS(objRS.Fields("FLSAccess").ActualSize)
arFLS= objRS.Fields("FLSAccess").value
intFLS =ascb(Midb(arFLS, i+1,1))
if ucase(application.BasicFunctions.CurrentUserID) = "ADMIN" then intFLS = 3
select case intFLS
case 0 : FieldAccess = "None"
case 1 : FieldAccess = "Read"
case 3 : FieldAccess = "Write"
end select
end if
set objRS = nothing
set objSLXDB = nothing
on error goto 0
end Function

'Just because I'm a lazy typer...
Function FieldAccessAcct(strtable, strField)
FieldAccessAcct = FieldAccess(strTable, strField, "Accountid", application.BasicFunctions.CurrentAccountID)
End Function

HTH!
Belinda
[Reply][Quote]
 Page 1 of 1 
  You can subscribe to receive a daily forum digest in your user profile. View the site code of conduct for posting guidelines.

   Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
 

 
 slxdeveloper.com is brought to you courtesy of Ryan Farley & Customer FX Corporation.
 This site, and all contents herein, are Copyright © 2025 Customer FX Corporation. The information and opinions expressed here are not endorsed by Sage Software.

code of conduct | Subscribe to the slxdeveloper.com Latest Article RSS feed
   
 
page cache (param): 8/27/2025 10:18:04 PM