Jump to content

Assigning Records


ianmuir

This topic is 4176 days old. Please don't post here. Open a new topic instead.

Recommended Posts

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.
Link to comment
Share on other sites

... so it looks like your script finds records with no userID, and you want to assign users to these records.  Do you want the script to do the assignment automatically?  If so, then you need some rules by which to assign the users.  Or does the user need to provide input to decide who gets assigned to what? 

Link to comment
Share on other sites

You need a field (global field), where you would enter a number of first records which you'd like to assign to a user and another global field where you could choose a user GlobalUserField. And then make a script:

 

...

...

 

#. Records found so loop them

Go to Record/Request/Page [ First ]

Loop

Exit Loop If [ Get ( RecordNumber ) > GlobalNumberField ] 

Set field [ Main Data::Assigned_to ; GlobalUserField ]

Go to Record/Request/Page [ Next ] 

End loop
Link to comment
Share on other sites

This topic is 4176 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.