Pablo Ramirez Posted February 8, 2003 Posted February 8, 2003 Hello everyone: I haven't been able to sort a portal using 2 different factors (date and person).The sort that is set when establishing the relationship, does not discriminate the person, only the date. I would like to be able to sort and obtain the 6 more recent dates of one person and paste that data in 6 fields. I included 2 sample files that better explain what I want to do. I really appreciate any help you can give me Sincerely Pablomac pablomac.zip
Ugo DI LUCA Posted February 8, 2003 Posted February 8, 2003 You are not looking for a sort, but a filter. create a g_name (global) in Portal layout create a relationship from portal to Master based on g_name::name. Change your portal using this relationship. Remove the name from the portal. Do remember to change each fields from portal using the new relationship. Bring to the Portal layout the g_name. Format this field to be a list from the values of Master. Choose Names from this file. Et voila... You now have a filter that will show you each information for a given person. Here is your modified file.
Pupiweb Posted February 8, 2003 Posted February 8, 2003 Pablo, check these tip files on dynamically sorting portals: http://www.filemakerpros.com/COLORPRT.sit http://www.buliga.it/TipFiles/Portali%20bidirezionali.sit
Pablo Ramirez Posted February 9, 2003 Author Posted February 9, 2003 Thank you so much for your help, now the sorting of the portals is working perfectly but I found another issue. In the files I attach you see there is a script that copies from the portal and pastes the value in 6 different fields. If the portal has six values works fine but when the portal has for instance 2 values (with john), then the script fills the remaining 4 values with the last value of the portal ??? Thank you again for any help Pablomac
Ugo DI LUCA Posted February 10, 2003 Posted February 10, 2003 Ok Pablo, you've just reached the limitation of the Copy/Paste function. What your script is doing is go to next row in portal Copy from Main file go to field1 in File A Paste go to next row in portal Copy from Main file go to field2 in File A Paste What it does is when there is "nothing" to copy (because you've reached the last record from the Main), it copies the content of the clipboard. Besides, use the Go to next row function (end after last). If you had put a pause in your script, you would have noticed that it stays to the last value. If you were using the Setfield function instead, if there is no record, it would set the field to nothing. Go to next row (end after last) Set field Field1,Filter for portal::Yes Go to next row (end after last) Set field Field 2, Filter for portal::Yes Try to forget about Copy/Paste
Pablo Ramirez Posted February 11, 2003 Author Posted February 11, 2003 Well, I don't know what happened but still does not work. It does exactly the same thing. When I have less than 6 records, it continues copying the last one. I have three different codes to perform what I want. Note: previous to these scripts, there is another script the "zeroes' all the variables from 1 to 6. 1) Go to portal row (No dialog, By number (1)) If S="All" Set Field ["Variable1","g_ptaname::Total BH W") End if If S="First" Set Field ["Variable1","g_ptaname::Total BHW_ONE") End if Go to portal row (No dialog, By number (2)) If S="All" Set Field ["Variable2","g_ptaname::Total BH W") End if If S="First" Set Field ["Variable2","g_ptaname::Total BHW_ONE") End if and so on for the remaining variables 3,4,5,6. 2) If S="All" Go to portal row (No dialog, By number (1)) Copy [select,"g_ptaname::Total BH W") Paste [select, "Variable1" If S="First" Go to portal row (No dialog, By number (1)) Copy [select,"g_ptaname::Total BH W ONE") Paste [select, "Variable1" and so on for the remaining variables 3,4,5,6. 3) If [s="All" Go to portalrow (Select, By number (1) Set field ["Variable1","g_ptaname::Total BH W"] End if If [s="First" Go to portalrow (Select, Exit after last, Next) Set field ["Variable1","g_ptaname::Total BHW ONE"] End if None of them work. It when there are less than 6 records, for example 2, the variable3 to variable6 are filled with the same value as variable 2. Any ideas would be greatly appreciated Pablomac
Pablo Ramirez Posted February 11, 2003 Author Posted February 11, 2003 Sorry, I found the problem. I had not updated the code in my application with the one I posted here and there were some differences!!! Now it is working!! Thanks a lot Pablomac
Recommended Posts
This topic is 7958 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