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!
|
|
delete delete button
Posted: 06 Apr 08 6:49 PM
|
I would like to disable the delete button for specific users. I did not see anything in AA hepfile. This seems like an 'out of the box' feature; but don't see anthing. Thanks for any assistance.
|
|
|
|
Re: delete delete button
Posted: 07 Apr 08 5:44 AM
|
no, there is no out-of-the box solution, you will need to script this either client-side or server-side |
|
|
|
Re: delete delete button
Posted: 09 Apr 08 12:19 PM
|
I need to have someone provide the code that we can Impliment. I also have 2 other similar items related to SLX 7.2 Web customizations. I am ready to pay a very fare price for what may be a small amount of work (or instruction).
Thanks for any assistance. Bill Miller
|
|
|
|
Re: delete delete button
Posted: 10 Apr 08 7:53 AM
|
Step 1 - From the menu remove(Edit-Delete) I am assumming you know how to do this; Create Custom Menu than modifies Standard menu, remove items....
Step 2 - At all levels where you want users to be able to delete records, Account, Contact, Opportunity, -Add a button to the form and call it btnDeleteRecord.(This name is used in code below.)
Step 3 - On the appropriate form where you have added the button, for example System:Contact Detail, add this code. '******************** Sub AXFormOpen(Sender) 'There may be other stuff here already????
SetDelete
End Sub '********************** Sub SetDelete 'This Sub allows access to the Delete Records button if the user is Admin or on the Records Management team. 'Jeff Parker 3/13/2007
Dim CurrentUser Dim RS Dim iCount Dim sSQL Dim slxDB Dim strTeamRecMan
'Getting the the UserID of the logged in user. Jeff Parker 3/13/2007 CurrentUser = application.BasicFunctions.CurrentUserid
If CurrentUser = "ADMIN" then btnDeleteRecord.Enabled = True btnDeleteRecord.Visible = True
Exit Sub End If
Set slxDB = New SLX_DB Set RS = SLXDB.GetNewRecordset
'Getting the the SeccodeID of the Records Management Team. Jeff Parker 3/13/2007 strTeamRecMan = GetField("seccodeid","seccode", "seccodedesc = 'Records Management'")
'Next Block of code determines whether or not the user is on the Records Management Team. Jeff Parker 3/13/2007 sSQL = "SELECT COUNT(*) FROM SECRIGHTS WHERE (SECCODEID = '" & strTeamRecMan & "') AND (ACCESSID = '" & CurrentUser & "')" RS.Open sSql,slxDB.connection
iCount = RS.Fields(0).Value
'If the user is on the Records Management team the delete button is functional, otherwise not. Jeff Parker 3/13/2007 If iCount = 0 then btnDeleteRecord.Enabled = False btnDeleteRecord.Visible = False Else btnDeleteRecord.Enabled = True btnDeleteRecord.Visible = True End If
Set slxDB = Nothing Set RS = Nothing
End Sub '************************** Sub btnDeleteRecordClick(Sender) Application.BasicFunctions.DoInvoke "Function", "Edit:DeleteItem"
End Sub '*********** Step 4 - Make sure that you have tied your btnDeleteRecord button to the event OnClick Step 5 - Then set up a Team, we called ours 'Records Management'. If you choose a different name the code would have to be modified. You simply add the users to the team that you want to be able to delete records.
I think that's about it!
Jeff Parker
|
|
|
|
Re: delete delete button
Posted: 10 Apr 08 11:10 AM
|
So would this work in the 7.22 web version? I was hoping for a non-coding issue for this. I find it hard to beleive there is no way to control simple security (that should be out of the box). But I do appriciate your post. I will look into how this would apply to our situation. Would you like a couple days work instructing us on how to do a few security tasks like this. We also need to disallow users from changing account names. |
|
|
|
Re: delete delete button
Posted: 10 Apr 08 11:20 AM
|
The fix I documented here was for a Network client. I am assumming that something similar could be done for the Web client although can't say for sure as we are not using the web yet. I was similarly disappointed when I looked for a simple security setting. Unfortunately, everything I found in out of the box security looked like shutting of deleting of records meant the same users wouldn't be able to add records.
The same methodology I laid out could be implemented for making controls that deal with the renaming of Account names. We have made other controls Read Only, not Enabled with similar code.
Not sure how I could help you. I am not a business partner but rather, a SLX developer working for a company with a lot of SLX users.
Jeff
|
|
|
|
Re: delete delete button
Posted: 10 Apr 08 6:34 PM
|
Originally posted by Bill Miller
I would like to disable the delete button for specific users. I did not see anything in AA hepfile. This seems like an 'out of the box' feature; but don't see anthing. Thanks for any assistance.
|
|
1) You'll create a LoadAction on the form and set it's OnRepaintEvent to true. 2) In the LoadAction you'll add a C# Snippet action 3) The C# code will have the logic to determine who can see it. Something like this (not tested code):
Sage.Platform.Security.IUserService svc = Sage.Platform.Application.ApplicationContext.Current.Services.Get<Sage.Platform.Security.IUserService>(); string userid = svc.UserId; // this assumes the name of the "Delete" toolbar item is named "btnDelete" // we'll show it for only the admin user btnDelete.Visible = (userid == "ADMIN");
Make sense?
-Ryan |
|
|
|
Re: delete delete button
Posted: 11 Apr 08 7:20 AM
|
Ryan,
Thanks for adding your post. My solution works great.....In the network client! Initially I didn't notice I was in the web Forum area.
Jeff |
|
|
|