8/18/2025 7:27:47 AM
|
|
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!
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.
|
|
|
|
Security tweaks on the History / Activity form...
Posted: 29 Nov 07 10:56 AM
|
One of my clients has requested that Notes, History, Activities, Attachments, etc (everything related to Accounts, Contacts, etc) have the ability to have different security than either the Account or Contact. (They have multiple users competing in some respects and don't want everything open - but they do want the Account's details and contact details shared.)
My immediate thought was to add SECCODEID to any tables that were missing it and add an owner lookup on all those forms and call it a day.
The problem I've run into so far is that I don't have access to the History Details form to edit the Insert statement. I then thought about running an Update statement on close, but I don't have the HistoryID.
How can I accurately add an Owner lookup to this form so that it saves properly? Or, is there a better method to solve this that I'm not thinking of?
(On 7.2.1 LAN Client only, for the record...)
|
|
|
|
Re: Security tweaks on the History / Activity form...
Posted: 30 Nov 07 11:13 AM
|
Well, to start, you don't have access to the Notes/History form? Is this SalesLogix standard version? That's rough... Anyway, I can't remember if this is the case, but even if you don't have access to forms' code, you might still have access to plain VBScripts - and if that's the case you're in luck. The SQL for the Notes/History grid is in an included script called Notes History Common. The method you are looking for inside that script is CommonCheckBoxChange. You can modify the code at the end to alter the datagrid to a disconnected grid, which means you can write your own connection string directly to the database, bypassing the SLX provider and avoiding the security that you don't need. You can also script in your own requirements in the same function.
To accomplish the task of altering the CommonCheckboxChange code for a direct database connection, you need to replace:
grdHistory.SQL.Text = strGridSQL grdHistory.Active = True
with:
Dim hCon, hRS, strCurrentID Set hCon = GetDirectConnection strCurrentID = Application.MainViews.ActiveView.CurrentID If strCurrentID = "" Then strCurrentID = "XXXXXXXXXX" strGridSQL = Replace(strGridSQL, ":BindID", "'" & strCurrentID & "'") Set hRS = hCon.Execute(strGridSQL) grdHistory.Recordset = hRS.Clone Set hRS = Nothing
And here's the function for GetDirectConnection:
Function GetDirectConnection() Dim strConn, gdcConn strConn = "Your SQLServerConnectionStringHere" Set gdcConn= CreateObject("ADODB.Connection") gdcConn.Open strConn Set GetDirectConnection = gdcConn End Function
Since you are going to have the username and password in the code, and since the code isn't very secure, you'll probably want to create a readonly account for SQL Server that is just for this purpose.
Edit: Fixed some code |
|
|
|
Re: Security tweaks on the History / Activity form...
Posted: 30 Nov 07 11:22 AM
|
This is the premier version - I must not have been completely clear - although you pointing out the 'CommonCheckboxchange' sub may have helped. I have access to the form - the problem is that form isn't as 'open' as most of the other forms.
Unfortunately for me, this is the tip of the iceberg. I need to do the exact same thing on Attachments and Activities. (Those are the only other forms that aren't wide open, right?)
The client has groups that compete and wants security to separate all notes, activities, history, etc while sharing the same Account / Contact detail information. (It's either that or create 20 copies of each account for each team - but then there's a huge synchronization / data update problem that would just blow it up.)
|
|
|
|
Re: Security tweaks on the History / Activity form...
Posted: 30 Nov 07 11:32 AM
|
Well, yeah, notes history isn't terribly simple to get through, but fortunately it is wide open for developement. However, as you mentioned with Attachments and Activities - those forms are hardcoded. It is possible to almost duplicate their functionality if you create new forms to go in place of those, but that will be quite a task You'll probably want to call for assistance if you aren't totally familiar with SalesLogix coding.
And yes, you certainly don't want to create 20 versions of each account... |
|
|
|
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!
|
|
|
|
|
|
|
|