Page 1 of 1

Where to store my custom variables (to use in default value field)?

Posted: Tue Dec 06, 2022 5:53 pm
by amiens80

hi,

for each field table, we have the feature to add a default value for search field.
The value must be a php expression, my expression is very long, so i wish to create a variable/function somewhere else to store it and then , in field seatup i could add the custom name variable.

so in Page_Rendering server event, i add
$my_customvalue="2022-01-01";

Then, in my table date field , in search column default value, i enter $my_customvalue in the cell .
but, once generated, i got this php error : " Notice: Undefined variable....: "
i also tried to enter in the cell : my_customvalue (without the dollar) but it is the same error.
it said i have to enter a php expression, so $my_customvalue is a php expression, so i don't understand why it did not work.

is default search field exclude from custom user variable ?


Re: where to store my custome php variables (to use in default value field) ?

Posted: Tue Dec 06, 2022 6:36 pm
by mobhar

You should declare the variable by using global keyword, for example:

global $my_customvalue;