3 Replies Latest reply on Dec 5, 2012 11:06 AM by philmodjunk

    Assigning records with a value list for users

    ian37

      Title

      Assigning records with a value list for users

      Post

            

           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" ]
           Exit script
           End if
           #. Records found so loop them
           Set variable [ $list ; ValueListItems ( Get ( FileName ) ; "userID" ) ]
           Set variable [ $count ; ValueCount ( $list ) ]
           Loop
           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 ]
           End loop
            
           I need to be able to pick which user to assign to and the number of records to assign.
           Can this be done?
            
           Many thanks.