Assigning records with a value list for users
I have a database with thousand of records. The users are held in a value list called userID.
I user this script to assign records to users.
Go to layout [ "Data" (Main data)]
Enter find mode [ ]
Set field [ Main Data::Assigned_to "=" ]
Set error capture [ On ]
Perform find [ ]
If [ not Get ( FoundCount ) ]
Go to layout [ original layout ]
Show custom dialog [ "no unassigned leads found" ]
#. Records found so loop them
Set variable [ $list ; ValueListItems ( Get ( FileName ) ; "userID" ) ]
Set variable [ $count ; ValueCount ( $list ) ]
Set variable [ $num ; Case ( not $num or $num >= $count ; 1 ; $num + 1
Set field [ Main Data::Assigned_to ; GetValue [ $list ; $num ]
Go to record/request/page [ next ; exit after last ]
I need to be able to pick which user to assign to and the number of records to assign.
Can this be done?