KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Class functions must be prefixed with 'exposed' when being called via POST request
PRODUCT: 4D | VERSION: 19 | PLATFORM: Mac & Win
Published On: June 12, 2023

When creating class functions, it may be easy to forget to prefix the function definition with the "exposed" keyword. For example, here is an entity selection class function for Table_1:

Class extends EntitySelection

Function test123
   $0:="hello world"


Next, a POST request made to a class function "test123" via "http://localhost/rest/Table_1/test123".



Note that without the exposed keyword, the class function test123 is not found. When including it:

Class extends EntitySelection

exposed Function test123
   $0:="hello world"