Why not use a portal to pull the clients pay info then sort the portal by Rank number? Your layout can still be sorted by Name.
Hi, S Chamblee
I've tried use a portal, and it doesn't work, I didn't know where goes worng, can you tell me more details? Thank you!
P.s Sorry, I click a worng link taht "Report Abuse".
How are you determining the rank number? Is this a calculation that use GetNthRecord to compare values to the previous record or are you using a different method?
One option is to use a script to find and sort your records to get the correct rank number, then use Replace Field Contents to copy the computed ranks into a simple number field--which can be in the related Table 1 table. Now you have a copy of the current ranking that does not rely on the current found set and sort order.
BUT, the drawback to this method is that the rank number in this number field will not automatically update when data in table 2 is updated, you have to run your script each time the data changes or at least each time that you pull up this layout to see the current rankings.
Yes, I rank the filed numbers by using GetNthRecord function, it works fun in Table 2, but it doesn't work in Table 1. I'm worndering if there is any way to automatically covert the Ranking filed in to an actual number in a new filed, then I can directly use this field to Table 1.
The Ranking field was calculated by this:
If ( Get ( GetNthRecord ) = 1 ; 1 ;
Let ( [PrevRec = Get (GetNthRecord )) - 1 ;
PrevTotal = GetNthRecord ( AMOUNT ; PrevRec ) ;
PrevRank = GetNthRecord ( RANK ; PrevRec ) ] ;
If ( PrevTotal = AMOUNT ; PrevRank ; Get (GetNthRecord )) )
As I mentioned in my last post, you can use Replace Field Contents to copy the results of your posted ranking calculation into a number field to store the current rank so that you can reference this value without needing the context of a sorted found set of records in Table 2.
I got you idea, but I don't know how to use this Replace Content Filed function. Would you mind if you could tell me more details about that, thanks.
In a script where your ranking is based on all records in the table:
Go to Layout [Table2 layout]
Show All Records
Sort [Restore ; no dialog]
Replace Field Contents [no dialog; Table1::RankNumber ; Table2::RankCalculationField ]
Go To Layout [original layout]
If the ranking is not based on all records in the table, perform a find instead of Show All Records.
It's possible, to replace "Table2::rankcalcualtionField" with the actual calculation used in that field. If so, you may not need the calculation field at all.
I've followed your direction, and it's works fine.