Results 1 to 4 of 4

Thread: write directly to Products

  1. #1
    stasila is offline Sugar Community Member
    Join Date
    Dec 2005
    Posts
    22

    Question write directly to Products

    Hi, I hope someone can help with this. I created new fields in Products module and it created new table in the database. “products_cstm”
    I want to write data into products directly though MySQL queries from my Online store database. My question is which table I need to write to and how these two tables products and products_cstm would work together.
    I’m really confused here with the ID.
    Please advice.

    Thanks,

  2. #2
    eggsurplus's Avatar
    eggsurplus is offline Sugar Community Member
    Join Date
    Dec 2005
    Location
    Minnesota
    Posts
    2,343

    Default Re: write directly to Products

    The products.id column ties to the products_cstm.id_c column so when doing an update you can join the two like:
    Code:
    update products_cstm pc
    inner join products p on pc.id_c = p.id
    set pc.mycustomfield_c = 'Hello World'
    where p.id = 'INSERT_GUID_HERE'
    Or more simply:
    Code:
    update products_cstm
    set mycustomfield_c = 'Hello World'
    where id_c = 'INSERT_GUID_HERE'

  3. #3
    stasila is offline Sugar Community Member
    Join Date
    Dec 2005
    Posts
    22

    Default Re: write directly to Products

    Thanks for quick reply. I also would have to associate it with product_templates which is product catalog.
    so when I run a query to Insert into products table and products_cstm it should grab the product name from the product_template somehow, can you please advice on that?
    thanks in advance.

  4. #4
    eggsurplus's Avatar
    eggsurplus is offline Sugar Community Member
    Join Date
    Dec 2005
    Location
    Minnesota
    Posts
    2,343

    Default Re: write directly to Products

    My best advice at that point is to get comfortable with the schema by looking at the tables available in the database and then build the scripts as you need it. My guess is that there's a product_template table of some sort that will get you what you need.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Importing contacts directly into db
    By anilg in forum Developer Help
    Replies: 9
    Last Post: 2009-04-06, 03:03 PM
  2. can I store the state directly in DB
    By sugarcare in forum Developer Help
    Replies: 7
    Last Post: 2007-07-25, 04:09 AM
  3. Linking directly to a persons calendar
    By Mike220474 in forum Help
    Replies: 1
    Last Post: 2007-06-22, 06:18 PM
  4. Importing directly to a Prospect List in 3.0
    By danielg in forum General Discussion
    Replies: 1
    Last Post: 2005-06-21, 05:31 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •