Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Saturday, February 22, 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!
 Web Forums - SalesLogix Web Platform & Application Architect
Forum to discuss the use of the SalesLogix Web Platform, Client and Customer Portals, and the Application Architect (For version 7.2 and higher only). View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to SalesLogix Web Platform & Application Architect | New ThreadView:  Search:  
 Author  Thread: delete delete button
Bill Miller
Posts: 5
 
delete delete buttonYour last visit to this thread was on 1/1/1970 12:00:00 AM
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.
[Reply][Quote]
Duncan Cook
Posts: 164
 
Re: delete delete buttonYour last visit to this thread was on 1/1/1970 12:00:00 AM
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
[Reply][Quote]
Bill Miller
Posts: 5
 
Re: delete delete buttonYour last visit to this thread was on 1/1/1970 12:00:00 AM
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
[Reply][Quote]
Jeff Parker
Posts: 32
 
Re: delete delete buttonYour last visit to this thread was on 1/1/1970 12:00:00 AM
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
[Reply][Quote]
Bill Miller
Posts: 5
 
Re: delete delete buttonYour last visit to this thread was on 1/1/1970 12:00:00 AM
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.
[Reply][Quote]
Jeff Parker
Posts: 32
 
Re: delete delete buttonYour last visit to this thread was on 1/1/1970 12:00:00 AM
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

[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: delete delete buttonYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 10 Apr 08 6:34 PM
Quote:
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
[Reply][Quote]
Jeff Parker
Posts: 32
 
Re: delete delete buttonYour last visit to this thread was on 1/1/1970 12:00:00 AM
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
[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): 2/22/2025 4:12:00 PM