Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Friday, June 20, 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: Need to access a menu's properties at runtime
Ronald Thompson
Posts: 6
 
Need to access a menu's properties at runtimeYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 25 Oct 07 11:14 AM
Does any one know how to access a menu's properties at runtime? Is it even possible?
[Reply][Quote]
muni1900
Posts: 21
 
Re: Need to access a menu's properties at runtimeYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 25 Oct 07 11:19 AM
If your menu is on a datagrid then I think you can access it as follows:

datagrid.Popupmenu.

If you want you can access items within a menu by:

datagrid.Popupmenu.Items(#).

Hope this answers your question.
[Reply][Quote]
Ronald Thompson
Posts: 6
 
Re: Need to access a menu's properties at runtimeYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 25 Oct 07 11:53 AM
Thanks muni,

But, I need to access a custom menu that I merged into the Standard Menu strip. I'm doing some work in 7.0 with secured functions and i have one secured function that is tied to a couple to different menu items. I wanted to know if there is a way to get the selected menu item's caption so i can perform some additional logic specific menu items.
[Reply][Quote]
Bob (RJ)Ledger
Posts: 1103
Top 10 forum poster: 1103 posts
 
Re: Need to access a menu's properties at runtimeYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 26 Oct 07 7:54 AM
No you cannot.... not even in v72 - never could.

BUT you could try creating a GS (Global Script) "handler" for each menu item..
Something like:
ex:
Function OnFunctionVisible_InsertFileAttachment(functionNumber, functionName)

... do something here.....
End Function

--
rjl
[Reply][Quote]
Mike Spragg
Posts: 1226
Top 10 forum poster: 1226 posts
 
Re: Need to access a menu's properties at runtimeYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 27 Oct 07 7:05 AM
Hi Muni, sure you can - it's not fun but you can either use the MenuIndex item to store a pointer (e.g. 1000-1015) during your setup of the custom menu - and then test that or you can get the menuitem caption but, beware, SLX will add an & to it (to indicate the accelerator key) so you need to strip that out first.

e.g.

Sub AXFormChange(Sender)
If GetField("ALLOW_ADD_ATT","E1TB_EVENTSEC","USERID = '" & Application.BasicFunctions.CurrentUserID & "'") <> "T" then
dgAttendees.EditOptions.ShowAdd = False
dgAttendees.EditOptions.ShowEdit = False
dgAttendees.EditOptions.ShowDelete = False
dgAttendees.ReadOnly = True
dgAttendees.PopupMenu.Items(1).Enabled = False
dgAttendees.PopupMenu.Items(2).Enabled = False
End If
BuildStatusMenuItems
End Sub

or

Sub dgAttendeesPopupMenuClick(Sender, Item)
Dim NewStatus, i, id
Dim objRS

If Item.Caption = "Add &by Account" then
PopulateByAccount
exit sub
End If

If Item.Caption = "&GoTo Contact" then
UpdateStatus dgAttendees.GetCurrentField ("ATTENDEE_CONTACTID")
Exit Sub
End If

NewStatus = Replace(Item.Caption,"&","")

For i = 0 To frmAttendees.dgAttendees.Selection.Count -1

Set objRS = GetSelectedRecordByID(frmAttendees.dgAttendees.Recordset, frmAttendees.dgAttendees.Selection.Item(i), "E1TB_ATTSID")
UpdateStatus "E1TB_ATTS","E1TB_ATTSID",objRS.Fields.Item("E1TB_ATTSID").Value, NewStatus

Next

Set objRS = Nothing

dgAttendees.Refresh
End Sub
[Reply][Quote]
Bob (RJ)Ledger
Posts: 1103
Top 10 forum poster: 1103 posts
 
Re: Need to access a menu's properties at runtimeYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 27 Oct 07 8:27 AM
Quote:
Originally posted by Mike Spragg

Hi Muni, sure you can - it's not fun but you can either use the MenuIndex item to store a pointer (e.g. 1000-1015) during your setup of the custom menu - and then test that or you can get the menuitem caption but, beware, SLX will add an & to it (to indicate the accelerator key) so you need to strip that out first.

e.g.

Sub AXFormChange(Sender)
If GetField("ALLOW_ADD_ATT","E1TB_EVENTSEC","USERID = '" & Application.BasicFunctions.CurrentUserID & "'") <> "T" then
dgAttendees.EditOptions.ShowAdd = False
dgAttendees.EditOptions.ShowEdit = False
dgAttendees.EditOptions.ShowDelete = False
dgAttendees.ReadOnly = True
dgAttendees.PopupMenu.Items(1).Enabled = False
dgAttendees.PopupMenu.Items(2).Enabled = False
End If
BuildStatusMenuItems
End Sub

or

Sub dgAttendeesPopupMenuClick(Sender, Item)
Dim NewStatus, i, id
Dim objRS

If Item.Caption = "Add &by Account" then
PopulateByAccount
exit sub
End If

If Item.Caption = "&GoTo Contact" then
UpdateStatus dgAttendees.GetCurrentField ("ATTENDEE_CONTACTID")
Exit Sub
End If

NewStatus = Replace(Item.Caption,"&","")

For i = 0 To frmAttendees.dgAttendees.Selection.Count -1

Set objRS = GetSelectedRecordByID(frmAttendees.dgAttendees.Recordset, frmAttendees.dgAttendees.Selection.Item(i), "E1TB_ATTSID")
UpdateStatus "E1TB_ATTS","E1TB_ATTSID",objRS.Fields.Item("E1TB_ATTSID").Value, NewStatus

Next

Set objRS = Nothing

dgAttendees.Refresh
End Sub


On the popups - absolutely.. it's in the lan dev helpfiles.

BUT.. the Standard menus.. no.. unless you trap them via GS handlers.. and even then it's nasty.
--
rjl
[Reply][Quote]
Mike Spragg
Posts: 1226
Top 10 forum poster: 1226 posts
 
Re: Need to access a menu's properties at runtimeYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 27 Oct 07 11:46 AM
Yes, but wasn't that what he wanted to do ? I'm sure that's what it looks like ?
[Reply][Quote]
Bob (RJ)Ledger
Posts: 1103
Top 10 forum poster: 1103 posts
 
Re: Need to access a menu's properties at runtimeYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 27 Oct 07 2:01 PM
Quote:
Originally posted by Mike Spragg

Yes, but wasn't that what he wanted to do ? I'm sure that's what it looks like ?


Note Ronald's 2nd post:
Quote:

But, I need to access a custom menu that I merged into the Standard Menu strip. I'm doing some work in 7.0 with secured functions and i have one secured function that is tied to a couple to different menu items. I wanted to know if there is a way to get the selected menu item's caption so i can perform some additional logic specific menu items.


rjl
[Reply][Quote]
Rekha
Posts: 72
 
Re: Need to access a menu's properties at runtimeYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 28 Oct 07 10:09 AM
Create a secure function in architect Manage Secure Function and put this code in global script. Menu item in standard menu should point to your newly created function as action item.

Function OnBeforeFunctionExecute_ToolsManageUserProfile(functionNumber, functionName)
Application.BasicFunctions.DoInvoke "Form", "Management:User Profile"
OnBeforeFunctionExecute_ToolsManageUserProfile = True
End Function
[Reply][Quote]
Rekha
Posts: 72
 
Re: Need to access a menu's properties at runtimeYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 28 Oct 07 10:10 AM
Hi Ronald try this,

If I understand your requirement correctly...

Create a secure function in architect Manage Secure Function and put this code in global script. Menu item in standard menu should point to your newly created function as action item.

Function OnBeforeFunctionExecute_ToolsManageUserProfile(functionNumber, functionName)
Application.BasicFunctions.DoInvoke "Form", "Management:User Profile"
OnBeforeFunctionExecute_ToolsManageUserProfile = True
End Function
[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/20/2025 11:08:41 PM