mastreck Posted February 21, 2008 Posted February 21, 2008 I am trying to write a script where duplicate dates in a portal are deleted. For example I have a database of people and related table of Attendance dates. Sometimes through an automated process, duplicated dates might get entered in a person's record in the portal. Is there a way to have a script that automatically finds those duplicates in the portal for that one person and deletes the duplicate dates? This could be a sub-script that is incorporated with the script that records the attendance in that portal field. Thank you.
mr_vodka Posted February 21, 2008 Posted February 21, 2008 do an advanced search for +duplicate +records and you will comes across many techniques on how to do this. Since a portal is simply a window into the related records, you can have it scripted to go to the related records and delete out the dups.
mastreck Posted February 21, 2008 Author Posted February 21, 2008 Ok, I have spent the last 1/2 hour looking, and I can't find one that relates to what I'm doing. Do you have a particular illustration in mind. I tried searching for an hour before I posted this question. Unfortunately, when you search for this topic, I get hundreds of posts to search through. Thank you.
mastreck Posted February 22, 2008 Author Posted February 22, 2008 (edited) Alight I know I'm a novice at this. I am trying a different way, instead of deleting duplicates, I put in something that prevents a duplicate. But what I have tried so far only checks the first row of the portal. I have tried loops, but can't seem to get them to work. Could someone tell me what I am doing wrong. This works only if the top portal record = the same date. I have in the script: Copy [select; AttenDate::AttenDate] if [FamAtten::AttenDate ≠AttenDate::AttenDate] Go to Portal Row [Last] Paste[] End If I guess the question is, how do I keep it going through all portal records to check for the date, and if it does not find it, then paste? Thank you for your help Edited February 22, 2008 by Guest
Jeff Bills Posted February 27, 2008 Posted February 27, 2008 (edited) This might help your initial desire. You'll have to create a self-joining relationship with each person and their duplicated attendance date. Let's call it "selfjoin-dates." You'll then replace the "keys_UID_c_SELFJOIN::UID_key_c" in the EXIT LOOP IF statement with "selfjoin_dates::datefield" and place selfjoin_dates::datefield in the portal. See the following for the way it was done in Filemaker 6. You'll need to add the "commit" step, I believe, to keep it valid in FM9 http://filemaker.custhelp.com/cgi-bin/filemaker.cfg/php/enduser/std_adp.php?p_faqid=848&p_created=1115172475&p_sid=Meq9qnZi&p_accessibility=0&p_redirect=&p_lva=&p_sp=cF9zcmNoPTEmcF9zb3J0X2J5PSZwX2dyaWRzb3J0PSZwX3Jvd19jbnQ9Nzk0LDc5NCZwX3Byb2RzPSAmcF9jYXRzPSZwX3B2PSZwX2N2PSZwX3BzX2Fuc191cGRhdGVkPSZwX3BhZ2U9MSZwX3NlYXJjaF90ZXh0PWRlbGV0aW5nIGR1cGxpY2F0ZXMgcG9ydGFs&p_li=&p_topview=1 Edited February 27, 2008 by Guest
Jeff Bills Posted February 27, 2008 Posted February 27, 2008 (edited) Also, it would be a good idea to sort multiple records and set the GO TO PORTAL ROW to "last" rather than next as it will save a script step in the loop. Edited February 27, 2008 by Guest
Recommended Posts
This topic is 6114 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now