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

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
amiens80
User
Posts: 450

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

Post 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 ?


mobhar
User
Posts: 11702

Post by mobhar »

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

global $my_customvalue;


Post Reply