Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Thursday, June 19, 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: Toolbar Modification
Lee
Posts: 22
 
Toolbar ModificationYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 13 Jul 07 9:09 AM
Hi Guys,

I've added a button to the main toolbar (the one with Item History, List/Detail View buttons) which runs a vbscript and works perfectly. However this button is intended for use only on the Opportunity screen and doesnt function as required on the Contact or Account screens.

Therefore my question is, is it possible to hide/disable the button when the user is on the Contact or Account screen?

I've noticed that the Opportunity Statistics toolbar button works in the way I'd want my button to. I think it has something to do with a Global Script. Normally i'd have a play around and have a good go at figuring it out myself but I dont feel too confident changing something so critical to the system.

Thanks in advance for any help.
[Reply][Quote]
Guy Barrett
Posts: 63
 
Re: Toolbar ModificationYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 13 Jul 07 11:20 AM
Hi Lee,

1) Open the Standard Toolbar from inside the architect you will notice that all of the buttons trigger 'hard-coded' Saleslogix functions that you do not have programmatical access to when clicked.

2) Open the script behind the Sales Dashboard MainView form, you will see at the bottom there is a section which enables and disables buttons on the toolbar. Eg...

Function OnFunctionEnabled_FileExportToExcel(MainView,functionNumber, functionName)
OnFunctionEnabled_FileExportToExcel = false
End Function

If you check out this function, it appears to relate directly to the function that the toolbar button calls, rather than the name of the toolbar button itself, in order to disable the button. (In the standard toolbar, the equivalent button calls a hard-coded SLX function called File:ExportToExcel).

I've probably added 2 and 2 together and got five, but I've got an idea that could be worth a shot (haven't had time to try it myself)...

1) Create a new toolbar button which opens a view. (In my case, I'd make a blank form called TEST for this button to call). Make sure the toolbar is released and visible.

Open the Sales Dashboard "Main View" (the one that is split into top pane, middle pane, tabs pane etc...

At the bottom if the script code, paste the following function underneath the existing similar functions...

Function OnFunctionEnabled_ViewTEST(MainView,functionNumber, functionName)
OnFunctionEnabled_ViewTEST = false
End Function


Now this is WAY out there, and I'm 95% sure it probably won't work as I think all of the 'Standard' toolbar buttons have hardcoded events that can be captured but you cannot create your own that can be trapped in the same way. However, if it works, you should be able to go to the Sales Dashboard and the button you created will be disabled but on other views it will be enabled.

Let me know how you get on. I'd hate to think I was wasting your time, but it shouldn't take long for you to try.
[Reply][Quote]
Guy Barrett
Posts: 63
 
Re: Toolbar ModificationYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 13 Jul 07 11:32 AM
As an addender you might want to go into the existing functions and pop in a "MsgBox functionName" just to see what Saleslogix is firing at these functions.
[Reply][Quote]
Rick Smith
Posts: 96
 
Re: Toolbar ModificationYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 14 Jul 07 7:42 AM
Here's an approach I've taken from within a form that might be launched from a Toolbar or Menu to ensure the user is in an apprpriate MainView:

Sub AXFormOpen(Sender)
If Application.MainViews.Count = 0 Then
MsgBox "You must be viewing an Opportunity to use this form.", , "Error"
btnOK.Enabled = False
Exit Sub
End If
If Application.MainViews.ActiveView.BaseTable <> "OPPORTUNITY" Then
MsgBox "You must be viewing an Opportunity to use this form.", , "Error"
btnOK.Enabled = False
Exit Sub
End If
End Sub

Perhaps not quite as pretty as disabling or hiding the Toolbar button but has the same effect.
[Reply][Quote]
Lee
Posts: 22
 
Re: Toolbar ModificationYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 16 Jul 07 3:59 AM
Thanks for the help gents!

For the short term I've used Rick's method which works great.

Guy I will certainly look into your method as soon as I can because as Rick rightly says it would be much prettier to disable/hide the toolbar.

I'll let you know how I get on.

Thanks again

Lee
[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): 6/19/2025 6:25:21 AM