KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Using SET ALLOWED METHODS and Groups to assign methods for Formula editor
PRODUCT: 4D | VERSION: 13.3 | PLATFORM: Mac & Win
Published On: September 14, 2013

The 4D command SET ALLOWED METHODS gives access to specific methods to be used in the Formula editor. The methods are available only during the current session, so the command has to run each time 4D is launched. If specific users are required to have access to the methods, the command SET ALLOWED METHODS has to execute each session.

One way to set the methods for certain users is to create a Group and add the specific users to the group. In the On Startup Database method, check if the user is part of the group, and set the methods they will need during the session.

Example using the 4D command User in group and SET ALLOWED METHODS:

ARRAY TEXT(methodsArray;1)

If (User in group(Current user;"Allow_Query_Users"))
 methodsArray{1}:="Query_Methods@"
 SET ALLOWED METHODS(methodsArray)
End if