Results 1 to 3 of 3

Thread: delete main & sub records

  1. #1
    mikesolomon is offline Sugar Community Member
    Join Date
    Feb 2008
    Location
    UK
    Posts
    1,467

    Default delete main & sub records

    I have set up 2 related modules

    job header & job detail

    At the moment if I delete a header record it does the following

    UPDATE zz_jobd_cstm SET zz_jobh_id_c=NULL, date_modified='2008-04-09 11:04:25' WHERE zz_jobh_id_c= '3187'

    Which is to unlink the detail record from the header record

    What I want it to do is to also delete any detail record

    Is this possible?

  2. #2
    mikesolomon is offline Sugar Community Member
    Join Date
    Feb 2008
    Location
    UK
    Posts
    1,467

    Default Re: delete main & sub records

    Thanks - I give it a go

  3. #3
    clint's Avatar
    clint is offline Sugar Team Member | Forums Lead Moderator
    Join Date
    Aug 2004
    Location
    Silicon Valley
    Posts
    2,120

    Default Re: delete main & sub records

    You will need to write some code to do that. You will want to create a custom logic hook for the zz_jobd module that calls the $this->mark_relationships_deleted() function which will delete all records linked to the Job Description.

    Here is also a recorded webinar that reviews building custom logic hooks.
    Sugar Developer Zone - developer resources | Sugar University - user and admin training
    Sugar Docs - user and admin documentation |
    Sugar Bug Tracker - Enter or view bugs
    SugarForge- open source modules, themes, lang packs | SugarExchange - commercial extensions

    Clint Oram
    Chief Technology Officer and Co-founder
    SugarCRM

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. How to delete records with the Sugar SOAP API?
    By sugarmichael in forum Developer Help
    Replies: 1
    Last Post: 2008-03-12, 09:55 PM
  2. Delete all records inside a certain module?
    By spac1x in forum Developer Help
    Replies: 5
    Last Post: 2008-02-21, 01:51 PM
  3. Contact Export misses some records
    By saradoo in forum Help
    Replies: 2
    Last Post: 2007-08-06, 06:12 PM
  4. Delete Records
    By cexar in forum Help
    Replies: 0
    Last Post: 2006-04-26, 07:15 PM

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
  •