AnsweredAssumed Answered

Renumber a found set in sorted order

Question asked by BarryYarkoni on May 5, 2015
Latest reply on May 6, 2015 by BarryYarkoni

Title

Renumber a found set in sorted order

Post

Disclaimer: FMP Newbie

I have a found set from the table "EquipmentUsage" with a field called UsageOrder.  This is a manually entered field where the user can specify the display order in a portal.  To change the display order, the user can change 4 to 2.5 and the portal will immediately change the display order.  I wrote a script assigned to a "Renumber" button which sorts and renumbers the found set to change everything back to a integer list as follows:  (dating myself here - anybody remember the old "Edit Renumber" in BASIC?)

Find Matching Records [Replace; EquipmentUsage::ContentID]
Sort Records by Field [Ascending; EquipmentUsage::UsageOrder]
Replace Field Contents [No dialog; EquipmentUsage::UsageOrder; Serial numbers]

What is happening is that the found records are being renumbered, but in their entry order, not the Sort Order.  So I tried this modification.  Created another field name TempOrder:

Find Matching Records [Replace; EquipmentUsage::ContentID]
Sort Records by Field [Ascending; EquipmentUsage::UsageOrder]
Replace Field Contents [No dialog; EquipmentUsage::TempOrder; Serial numbers]

Same result.  Any suggestions on how to get it to assign serial numbers to the found set by the sort order??

Many thanks.
Barry

 

Outcomes