Connecting to another company database
  • coldrick
    Posts:61
    Joined:Wed Mar 12, 2008 10:31 am
    Location:Queensland
    Contact:
    Connecting to another company database

    by coldrick » Wed Mar 12, 2008 4:24 pm

    Situation:
    Two companies in CAPITAL
    Some products stocked by the two companies overlap using the exact same part number

    Question:
    Is it possible for the stock lookup screen to link to the other company stock.dbf database to show their available quantities?
  • COBS Tech Support
    Posts:683
    Joined:Fri Sep 09, 2005 8:23 am

    by COBS Tech Support » Thu Mar 13, 2008 1:04 pm

    This should be possible but would require at least the Enterprise or Corporate Editions.

    Firstly, you would need to add your own 'user' column to the find/look-up window. The topic: "Stock Find User Column Hook (R-SFColn.MAC)" explains how to do this.

    Secondly, you would need to open the second stock file within the column. You can use the OpenTable() function to do this (consult the Visual Builder help file) but you would need to specify both a path and an alias, i.e.,

    OpenTable(PathData() + "Company2\Stock.dbf", "Stock2")

    Then use Find() to locate what you are after, i.e.,

    Stock2->(Find(Stock->Name))
    Last edited by COBS Tech Support on Thu Mar 13, 2008 7:57 pm, edited 1 time in total.
  • coldrick
    Posts:61
    Joined:Wed Mar 12, 2008 10:31 am
    Location:Queensland
    Contact:

    by coldrick » Thu Mar 13, 2008 7:21 pm

    I'm only fairly new to the scripting, but I got this working.

    Declare StockAtB Type Character
    OpenTable("Z:\CAPITAL\TESTCO2\Stock.dbf", "Stock2")
    Stock2->(Find(Stock->Name))
    StockAtB := Stock2->Stock_In
    Return { "Stock at Other Company", "Stock LOC2", 12, 2, 15, StockAtB }

    Thanks.

Who is online

Users browsing this forum: No registered users and 1 guest