Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Moving data between two identical modules

  1. #1
    truptinijai is offline Member
    Join Date
    Feb 2009
    Posts
    7

    Default Moving data between two identical modules

    Hi all,

    I have cloned the opportunities module in version 5.2a and renamed the new one as opportunities1 .
    How do I simply move an entire record in opportunities to opportunities1.
    Ideally would need to do this with a button click.(The duplicate button in view page clones the record within the module itself).

    Regards,
    Trupti Nijai
    Last edited by truptinijai; 2009-02-24 at 04:29 AM.

  2. #2
    sanjaykatiyar1's Avatar
    sanjaykatiyar1 is offline Sugar Community Member
    Join Date
    Feb 2006
    Location
    Bangalore
    Posts
    600

    Default Re: Moving data between two identical modules

    If opportunities1 module is clone of opportunities then you can export the record as csv file from opportunities and import into opportunities1.
    Sanjay Katiyar
    iPhone and Android solutions http://www.apptility.com

  3. #3
    truptinijai is offline Member
    Join Date
    Feb 2009
    Posts
    7

    Default Re: Moving data between two identical modules

    Hi Sanjay,

    Thanks for ur reply.
    But I need a button click solution, instead of a lengthy solution.
    is that possible???

    Thanks & regards,
    Trupti Nijai

  4. #4
    knoop is offline Sugar Community Member
    Join Date
    Aug 2010
    Posts
    79

    Default Re: Moving data between two identical modules

    Hi!

    Did you found a solution for this?
    I've got two the same modules, I also got a custom button on both edit views. I need a code to move my record with the help of that button...
    Prod: Version 6.1.0 (Build 5389)
    Test: Version 6.4.2 (Build 7526)

  5. #5
    robertbmirth is offline Sugar Community Member
    Join Date
    Jun 2010
    Location
    Irvine, CA
    Posts
    345

    Default Re: Moving data between two identical modules

    well, there are two things you can do. If you wanted this to happen for every record, i.e. automatically, then you can write logic hooks to synchronize the two tables (note that you'd have to add an extra field in each module to keep a record of what record the current record is synchronized to). If you only wanted to do it for specific records, or at specific times, I haven't done this but you can get a pretty good idea by looking at the leads' convertlead functionality. You can add custom functionality to a button and create a special view to go to when that button is pressed. The button is added in the viewdefs file (editviewdefs.php, detailviewdefs.php; whichever view you feel it applicable to add to. You can see this being done in the following code which is pulled from modules/lLeads/metadata/detailviewdefs.php:
    PHP Code:
    $viewdefs['Leads']['DetailView'] = array (
        
    'templateMeta' => array (
            
    'form' => array (
                
    'buttons' => array (
                    ...
                    array (
                        
    'customCode' => '<input title="{$MOD.LBL_CONVERTLEAD_TITLE}" accessKey="{$MOD.LBL_CONVERTLEAD_BUTTON_KEY}" type="button" class="button" onClick="document.location=\'index.php?module=Leads&action=ConvertLead&record={$fields.id.value}\'" name="convert" value="{$MOD.LBL_CONVERTLEAD}">'
                    
    ), 
    If you look at modules/Leads/views/view.convertlead.php you can see where this button references.

    Note that there's probably going to be a little more to this process than I've uncovered. There are some labels there that need to be defined and I'm guessing you might have to fiddle with the controller as well. Also, remember to put all your modifications in the custom directory so that you stay upgrade safe.
    Robert Beckman
    Software Engineer
    Mirth Corporation

  6. #6
    AlexAv's Avatar
    AlexAv is offline Sugar Community Member
    Join Date
    Oct 2009
    Location
    Ukraine
    Posts
    922

    Default Re: Moving data between two identical modules

    Does module works correct? I mean new records , relations ... etc.
    Letrium ltd. - Only high quality service
    http://letrium.com

  7. #7
    knoop is offline Sugar Community Member
    Join Date
    Aug 2010
    Posts
    79

    Default Re: Moving data between two identical modules

    Both modules are working fine.
    I don't want to move records automatically. When I hit the button 'Convert', I want to move a record from the original Accounts module to my custom accounts module.

    In the original module I've got all potential customers. In the new module I convert these records to Customers.

    The only question is... what do I have to put behind the button?
    Prod: Version 6.1.0 (Build 5389)
    Test: Version 6.4.2 (Build 7526)

  8. #8
    AlexAv's Avatar
    AlexAv is offline Sugar Community Member
    Join Date
    Oct 2009
    Location
    Ukraine
    Posts
    922

    Default Re: Moving data between two identical modules

    You can do it with database query.
    Letrium ltd. - Only high quality service
    http://letrium.com

  9. #9
    knoop is offline Sugar Community Member
    Join Date
    Aug 2010
    Posts
    79

    Default Re: Moving data between two identical modules

    Thanks for you suggestion. They only problem is that I need some more information. I'm not yet an expert in php and MySQL. So if you've got some more information in detail it would be appreciated
    Prod: Version 6.1.0 (Build 5389)
    Test: Version 6.4.2 (Build 7526)

  10. #10
    AlexAv's Avatar
    AlexAv is offline Sugar Community Member
    Join Date
    Oct 2009
    Location
    Ukraine
    Posts
    922

    Default Re: Moving data between two identical modules

    Simple example you can find there
    Letrium ltd. - Only high quality service
    http://letrium.com

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. How to move data from one module to another?
    By truptinijai in forum General Discussion
    Replies: 2
    Last Post: 2009-02-20, 10:14 AM
  2. "search button" press which file is call in Basic Search.
    By shyam007 in forum Developer Help
    Replies: 4
    Last Post: 2009-01-12, 02:56 PM
  3. Replies: 1
    Last Post: 2008-06-13, 10:35 AM
  4. Replies: 3
    Last Post: 2007-09-06, 11:49 PM
  5. Replies: 2
    Last Post: 2007-08-22, 04:19 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
  •