This topic is locked
[SOLVED]

Hide field in spreadsheet but still populate default values?

5/6/2021 2:47:03 PM
PHPRunner General questions
A
AlphaBase author

I have a grid as a spreadsheet with some hidden fields:

Before display event:
$pageObject->hideField("status");
$pageObject->hideField("Priority");
$pageObject->hideField("Date_Req");
$pageObject->hideField("percent");
$pageObject->hideField("Heirarchy");

Each of these fields has a default value when entering a new record. But they default is not being populated. How can I populate the defaults?

Admin 5/7/2021

Default value is what will be displayed in the field initially on the Add page. If you hide the field there is no way to display anything there.

What you need to do is to update that field value behind the scene using an event like BeforeAdd:

$values["fieldname"]="some value";

A
AlphaBase author 5/7/2021

Great. Thanks. That's just what I was looking for.