We can display custommenu items for a specific custommenu based on layout table occurrence or layout name. Here I have given an example for display the custom menu item based on the layout table occurrence.
Suppose we have a custommenu named as “ModuleSpecific” in a file, which is having different tables.
If we want to display specific actions scripts based on the table occurrence in layouts based on its layout base table then we need to follow the below mentioned procedure.
1. First thing we need to change is its MenuItemProperties against the menuItem. That is its Title name, which need to be conditional.
3. Script attched to that custom menu item will be like this:
If [ Get ( ScriptParameter ) = "TableOccurrence1" ) ]
Perform Script [ “TableOccurrence1 script” from file: “TableOccurrence1 file”; Parameter: Get ( ScriptParameter ) ]
Else If [ Get ( ScriptParameter ) = "TableOccurrence2" ) ]
Perform Script [ "TableOccurrence2 script” from file: “TableOccurrence2 file”; Parameter: Get ( ScriptParameter ) ]
Now it will display the custom menu item depending upon its base layout table name used in the title part and for those layouts it will not match with the above mentioned title condition it will display blank.