Display Detail with no Record? (v2019)

Hello All!

I have an interesting situation, please bear with me, as I’m unsure how to describe it.

I am attempting to implement a Detail View/Edit system for users to be able to adjust what they see on their ‘products’ list with a “Favorite” or “Hide” system.
The issue is that there are actually 3 states… 1. Normal (null), 2. Favorite (1), 3. Hide (2)

I have a ‘favhidestate’ table setup with fields:
id, sourceuser, destproduct, favhidestate

Most of the relationships between users and products will be “Normal” (i.e. there won’t be a record in the database to show the “Normal” state, I’ll only need to add “Favorite” (1) or “Hide” (2) states to the detail table.

I’ve got it kind-of working, however only with a drop-down list in the detail view/edit, and only if I pre-populate the detail table with data.

If I don’t have a record in the detail table between a user and a product, then the detail view/edit isn’t even displayed. Seems there MUST be a detail record for it to even give the option to set a new value.
I have a dropdown created with the following values for favhidestate
[blank] - Normal View
1 - Favorite
2 - Hide

The first question that comes to mind, is there a way to force the detail view to be displayed, even if there isn’t a record match?
(Seems I have to have data in the table like :
1, 22, 2
1, 23, 1
1, 25, NULL

Considering that 98% of users will be displaying most products in “Normal” mode, I can’t imagine a table that has every combination of user to product with a NULL entry in the database. (or is this normal practice to just let the table bloat??)

My goal is to:

  1. display the detail table for products even if there isn’t an entry in the table.
  2. When a user sets the value back to “Normal” view (i.e a ‘NULL’ in favhidestate), the record is DELETED.

I hope this makes sense!

Thank you,
BK

Why don’t you add “0” instead of null for Normal View? This should be able to resolve your issue.

Hi,
I’ve tried this. Same result.
If I prepopulate the table with 0’s, then all is good, however the favhidestate table is blank to begin with.


I think the detail view is not being displayed because the query is returning zero records, (As a relationship between user and product hasn’t yet been established and saved to the table (so no entry in the table yet exists).

How do I force the detail selection view to display, when there isn’t a corresponding detail record?

Thank you.

(I’ve even tried setting various defaults (in the Field… tried “0”, ‘0’, and 0) with the same results…
It seems that the Detail Table NEEDS to have a record for it to be displayed. (Otherwise the Master Edit screen just shows the title of the Detail View)

How do I force the detail selection view to display, when there isn’t a corresponding detail record?

You should be able to display the detail table, whenever the detail table does not have the relationship to its master table.

mobhar wrote:

You should be able to display the detail table, whenever the detail table does not
have the relationship to its master table.

Yes, I was thinking the same thing. Is there a way to troubleshoot this?

Thank you.