Hello! 😊 I have a properties
database that stores data about individual real estate properties. I have a property
page that I'm using to:
view a real estate property's details;
edit a real estate property's details;
create a new real estate property.
For #1 and #2, I have no problems; I perform a Document from Reference query that retrieves data about a property via a Doc Reference propertyID
page parameter. I also have a pageMode
parameter of type Enum with 3 options: "view", "edit" and "create" for conditional visibility purposes.
For #3, I keep running into various "Unexpected null value" errors whenever I create a "Create new property" link (pageMode = create
) from another page that either
(a) doesn't pass a propertyID
parameter, or;
(b) passes a "Null" value for the propertyID
parameter.
Note: the Debug Panel, when running the page with pageMode = create
, shows that a widget propertyFeatureName
has Null value, however all of those component widgets clearly have manually inputted strings as value (i.e. aren't tied to a Document):
Questions:
Is what I'm trying to achieve (i.e. 1 page to view/edit/create a Document) possible?
When there is a conditional visibility not achieved, does the code still "run under the hood" for that widget? For example, if I have a Text widget with a variable String (pulled from the page-level query), could that cause an error if the variable isn't found due to the backend query looking up a null or non-existent Document?
Why does it say that
propertyFeatureName
is Null when I pass a null or emptypropertyID
parameter?
Thank you very much for your help!