But a portal displays multiple records, so when you want to "duplicate the fieldsf from Portal A", from which record in Portal A do you want to duplicate these fields and in what record will you put that duplicated data?
In other words, please describe the design of your system in more detail and what you are trying to do.
The overall problem has appeared in previous threads. The table relationships currently are:
Drugs----<Druglist_rx>-----Prescriptions-----<Input----<Druglist_in>---Drugs 2 (TO of Drugs)
Prescription, DrugList_rx, Input and DrugList_in are all shown in portals on a layout from a related table, 'L Patient Copy'.
I need the Drug IDs from Druglist_rx and Input ID from Input, to appear in DrugList_in every time a new Input record is generated. Obviously this is only to occur if there are Drugs listed in DrugList_rx. However, DrugList_in also needs to update should someone who has already generated an Input record along with a DrugList_in record, but then realises that their original 'parent' Prescription is incorrect and needs a Drug added or deleted. In such a case it's difficult to see how the amounts entered beside DrugList_in records won't lose synchronisation with the DrugList_rx list (both are scroll lists in portals).
I have therefore wondered if it would be best to combine Prescription and Input and, separately, DrugList_rx & DrugList_in. The latter overcomes the problem of synchronising the different drugs lists in their portal. However, because a prescribed DrugList is often similar from one Prescription to another, I'd often duplicate the Druglist_rx, but I don't want to duplicate the 'input amounts' as these would vary greatly. Hence the question of how to duplicate a record but not all of the field values.
Of course if there's a better way to achieve the aim, I'd be interested. NB. Throughout the layout, records are generated via button scripts.
The overall problem has appeared in previous threads.
But after over 60,000 comments posted on various threads here, I am unlikely to accurately recall those details even if I happen to recognize that this is a post based on the same project. (Even recognizing your name wouldn't tell me that as you might be working on a different project than that which went before.)
Please do not assume that I am correctly remembering any details from a previous post. (There is even more than one person dealing with a project where they have lists of prescribed drugs right now.)
When I think of "prescription", I think of one order by a doctor for one specific drug to be administered to one specific patient. Since you link a "prescription" record to multiple drugs, that doesn't appear to be the case here. So let's start with a basic question:
What does one record in prescription table represent?
In answer to the question on the end:
Each Prescription record calculates results from DrugList_rx records. You will normally have several drugs prescribed per patient "Prescription". In addition, Input records are related to the Prescription and show clinical data. And for each input, there is a specific DrugList_in record mirroring each drug in DrugList_rx.
I'd had 4 tables, 1 for each of the above, each shown separately on a Patient layout. However, because of space restriction, I'd only wanted to have drug names shown in DrugList_rx and the actual input shown in DrugList_in. The problem is that the 2 portals won't be synchronised to scroll together so I'd thought to combined Prescription and Input in 1 table & portal, with DrugList_rx & DrugList_in in another table and portal. Because for the latter druglists prescribed will often be similar I'd duplicate to generate a new record. However, I only want the prescription (drug name, amount prescribed) duplicated, I'd want the actual input left blank. Can the latter be achieved by an Auto-enter calc:
not isempty(Xfield); "";
Might there be any un-wanted problems with this approach?
I can't answer any questions specifically because I am still seeking a clear understanding of your design.
I understood from the beginning that prescription links to a list of drugs prescribed for a given patient. But what I am seeking to understand is if you created 3 different records in prescription for the same patient, what makes one record different from the other besides the associated list of prescribed drugs? Would this represent 3 different points in time? so that each time a patient's dosage or prescribed drugs change, you create a new prescription record?
That's my guess here, but prefer not to guess...
You would create 1 prescription record per day. The druglist would be for that day. It is possible users would choose not to record inputs every day and might use the solution for occasional audits. However, Prescription records and their related druglist would apply to 'a day'.