October 1, 200322 yr I'm using the duplicate record/request to copy the record. But I would also like to copy the information in the portal fields as well. Any ideas on how I should go about this? Thanks for any help!
October 1, 200322 yr The portal fields are really in the related file. If you want the same records to show up in the duplicate record, you just need to have the same value from the orginal record in the field that your relationship is based on. I'm not sure why you would want to do this. Mike
October 1, 200322 yr Author I will try to explain... I'm using a portal in a database to create a test request (labwork). The portal contains part #'s and item #'s. I made a button to duplicate the old request and delete the fields I want left blank (setfield ""). The number in the origional record field (relationship) was auto numbered (serial #). When the new record is created a new number is generated (cant have the same number, needs to be unique).
October 1, 200322 yr Ok, I understand. So now I'm assuming that you are now wanting to duplicate all the part #'s and item #'s in your other file? That seems like a lot of redundant information especially if there are a lot of parts & items for each test request. You probably would want a third file that is a join between the test request file and the parts/items file. The third file would be records of each item used by each test. File A = Test Request File B = Test Items File C = Parts & Items File B is related to File A via the Test ID File C is related to File B via the Item/Part # File B would have calculated fields to pull in the Part/Item description, etc and then could be displayed in the Portal in File A. This technique is known as tunneling or pipeline. Someone else may have a different way. Hope this makes sense, Mike
October 1, 200322 yr Wait, I forgot that you still need to create new records. You will need to create a script in the TestItems file to find the records associated with the current record in Test Request and loops through the found set duplicating each one and setting the Test Request ID field to the new ID from the Test Request file. Mike
October 1, 200322 yr mzimm, Here is a quick and dirty example of what I tried to describe. Keep in mind that this example is not what my normal finished products look like, it is just for you to examine the relationships and scripts. The main file is Test Request.fp5 HTH, Mike test request.zip
October 2, 200322 yr Check out this thread: http://www.fmforums.com/threads/showflat.php?Cat=&Number=1463&page=0&view=collapsed&sb=5&o=186&fpart=1
October 2, 200322 yr Bob, Thanks for that link. I had forgotten about Chuck's post. When I compared his script with the one I provided in the attachment, they are pretty close. Mike
Create an account or sign in to comment