by COBS Tech Support » Wed Feb 15, 2006 8:20 am
Try the following script. It is recommended that before running the script you go the Stock Control area to open all the required tables.
* Copy stock field to user field
Stock->(GotoTop())
:Loop
If Stock->(EOF())
Goto End
Endif
* Try to find user fields record & if it
* doesn't exist, create it
If .Not. STAUX000->(Find(StockID()))
STAUX000->(AddRecord())
STAUX000->Auxkey := StockID()
Endif
* Lock the record so it can be changed
* Copy field 'Location' into 'User1'
If STAUX000->(LockRecord())
STAUX000->User1 := Stock->Location
Endif
STAUX000->(UnlockRecord())
* Move to next record
Stock->(Skip())
Goto Loop
:End
Echo("Done")