I know many of us use LaunchForm or Context Menu Open With among other things. I thought I ask this question for all our sakes.
Lets say you have:
Production Management / General Operations / My Cool Dashboard [ UDB001 ] [ USEC001 ]
Sales Management / General Operations / My Cool Dashboard [ UDB002 ] [ USEC001 ]
Both have a Unique Menu ID, because they have to, however both share the Same Security ID. Because we will control the Sub-Folders who gets to see what.
So when you do LaunchForm you hardcode UDB001 for example. But what if the User does not have access to “Production Management”. I can’t recall properly but I could have sworn that it didn’t let me launch UDB001 in 10.1.500.x
But the User has UDB002 which is the same.
I have been thinking about this, but never dug deep into the research and I know Epicor has some helpers to find the proper Menu ID by looping through the MainForm Tree. Atleast I saw that in some .NET Reflecting. Anyone recall the helper class?
Basically sometimes I place a Dashboard or UD01 Table in 10 locations, so they are accessible and share the same Customization, but I don’t want to hardcode MENUID001 if the user only has MENUID009.
Maybe I did my test wrong and It will open it regardless of Parent Path having Access. I’ll test that again today; thought Id throw this out in-case someone else already has.
If the User does not have permissions to open PJGO1010 because it uses SEC18982; it will give you a MessageBox stating that you don’t have permissions. It happened to me also when the user did not have Persmissions to a Sub-Folder (Parent to the Menu).
So Hardcoding MenuID’s not cool. I have to test that in 10.2.300.
I did some initial research 3 months ago and found Epicor had some Helper Methods to basically locate an Alternative ID (basically looping through the Menu Tree until it Finds one you have access to). I need to review that again.
Same with Open With… What if you create a Context Menu Entry for “UD001” but the user doesn’t have UD001 (because its Parent Folders) restrict the user…BUT he does have access to UD002 which is the same just another Path… Your Open with isn’t smart enough to figure it out
I did a quick test of adding a test user to the Disallowed Users of the Material Management menu. That user was still able to launch Part Entry from a Part field in a Sales Order Tracker.
Next I added that user to Disallowed Users of the Part Entry menu’s (MenuID: IMMT1102), Seurity (SecID:SEC159). User could still use “Open With…”
I think Epicor does not Hardcode their LaunchForms… Because they specify the Program, not the MenuID – So I assume it then “loops through” the Main Menu and finds the nearest avail MenuID because it needs to Honor your “Customizations”.
After thinking about it for a bit, it seems like MenuID’s are “shorcuts”, that callpass the program name to launch.
Since you can restrict access to menus (aka the “shortcuts”), the security processes prevent the launch request from ever finding out which program to launch.
The FormFunctions.GetMenuItem and Arguments I think help find that Menus args “Customization” etc…
Anyways. I’ll do some testing later on best way to use LaunchForm and to make sure I am not hardcoding myself to death… What if you delete “UD001” because you dont need it anymore… Do you want to keep a Spreadsheet to find all the Customizations where UD001 has to change to UD002 now? probably not. So I think using the Program Name is probably better.
Syncs Process, Context and other .xml’s based on Users “Security” and update xml’s in C:\ProgramData
When using LaunchForms or Open With…
3.1 Check if MenuID is in the .xml
3.2 If LFO used ProgramName, find the MenuID in the .xmls
3.3 IF IT Exists; Check Security; if Pass Launch?
I’ll check… But I am guessing if I add a button to LaunchForm Part Entry from UD01 and then take Security Away to every other folder/sub-folder for myself besides the one where UD01 is it prob will say I dont have access because It couldnt find a single Match to Resolve to - Because the Folders (General Operations) are restricted, while the Menu ID within them is not.