The two additional "COPY SET" lines below have worked for me.

$ListBoxName:="CCTransactionsLB"
COPY NAMED SELECTION([CC_Transactions];"TempCurrentSet")
LISTBOX GET TABLE SOURCE(*;$ListBoxName;$tableNum;$namedSelection;$highlightSet)

COPY SET($highlightSet;"$tmpSet")  // Store the highlighted set in case it gets 
lost
USE SET($highlightSet)

//Do stuff with the records

USE NAMED SELECTION("TempCurrentSet”) //get the selection back
CLEAR NAMED SELECTION("TempCurrentSet”)

COPY SET("$tmpSet" ;$highlightSet)  // The records should highlight here

Keith - CDI

> On Sep 3, 2017, at 10:01 PM, Sannyasin Siddhanathaswami via 4D_Tech 
> <[email protected]> wrote:
> 
> Aloha,
> 
> I don’t quite understand why my highlighted records are lost. 4D Server v15.4 
> Mac.
> 
> I’m doing the following in a button on the form that has a listbox.
> 
> $ListBoxName:="CCTransactionsLB"
> COPY NAMED SELECTION([CC_Transactions];"TempCurrentSet")
> LISTBOX GET TABLE 
> SOURCE(*;$ListBoxName;$tableNum;$namedSelection;$highlightSet)
> USE SET($highlightSet)
> 
> //Do stuff with the records
> 
> USE NAMED SELECTION("TempCurrentSet”) //get the selection back
> CLEAR NAMED SELECTION("TempCurrentSet”)
> 
> Once the button method is finished, the listbox highlight disappears. No 
> other code is executed after the button finishes.
> 
> I can understand if changing the selection causes the highlight to be lost, 
> but then, how do I set the highlight again?
> 
> HIGHLIGHT RECORDS doesn’t work for listboxes.
> 
> Thanks!
> 
> 
> 
> 
> 
> Sannyasin Siddhanathaswami
> **********************************************************************
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> Archive:  http://lists.4d.com/archives.html
> Options: http://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:[email protected]
> **********************************************************************

**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[email protected]
**********************************************************************

Reply via email to