MAC script transfer data from one field to another
  • Garry Vajda
    Posts:2
    Joined:Fri Feb 10, 2006 10:12 am
    Location:Maroubra NSW
    Contact:
    MAC script transfer data from one field to another

    by Garry Vajda » Fri Feb 10, 2006 10:24 am

    capital Office 2.75 MAC script required.
    For all stock, copy the contents of Stock->Location field to a custom Stock_Field and then delete contents of the Stock->Location field
  • COBS Tech Support
    Posts:683
    Joined:Fri Sep 09, 2005 8:23 am

    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")

Who is online

Users browsing this forum: Bing [Bot] and 6 guests