Attachment - Add to Parent or Child Record?

Well, i managed to solve my first problem myself by talking it through in text on the forum, let's see if i figure this one out on my own ๐Ÿคฃ

I am making an internal app for the billing department to keep track of issues they are having with our claims processing and EMR platform in the clinic (this is an enterprise level application and not appsheet based). Our leadership team is big on data and want to be able to capture some metrics and analyze the data in Google Data Studio, Looker, or whatever they're calling it today.

The app is working from the standpoint of being able to create/log an issue and add updates to document the progression, with a final option to mark an issue as resolved.

I'd like to add the functionality to add attachments to the parent item in the billing_issues table or to an added comment in the issue_updates table.

I have created an attachments table to facilitate this but am hung up on how to properly attach a record to one or the other of the two main tables without the need for multiple tables. Here's what i have so far:

mykrobinson_0-1680552975238.png

 

the record column is a ref to the key in the billing_issues table, and update_id is a ref to the key in the issue_updates table

My first thought is to create two actions that do a linktoform() action to take the user to the attachments form, and the action prefill either the record column or update_id column based on where the action originates.

Any thoughts or ideas on that approach?

 

 

Solved Solved
1 1 129
1 ACCEPTED SOLUTION

Is it that an attachment record will always be part of the parent, but only sometimes part of a specific child? Then yes, 2 LINKTOFORM actions, 1 from parent auto-filling the parent key, and 1 from child auto-filling both parent and child key.

A related tip: foreign key ("Ref") columns are typically named to mirror the name of the table being referenced. [record] as a reference to "billing_issue", and [update_id] as a reference to "issue_update" is confusing as hell. Better to be named [billing_issue_id] and [issue_update_id] (or even skip the "_id" suffix).

View solution in original post

1 REPLY 1

Is it that an attachment record will always be part of the parent, but only sometimes part of a specific child? Then yes, 2 LINKTOFORM actions, 1 from parent auto-filling the parent key, and 1 from child auto-filling both parent and child key.

A related tip: foreign key ("Ref") columns are typically named to mirror the name of the table being referenced. [record] as a reference to "billing_issue", and [update_id] as a reference to "issue_update" is confusing as hell. Better to be named [billing_issue_id] and [issue_update_id] (or even skip the "_id" suffix).

Top Labels in this Space