Results 1 to 5 of 5

Thread: Werd things with creating a record for a new 1/1 module

  1. #1
    Socal is offline Member
    Join Date
    Jun 2010
    Posts
    18

    Question Werd things with creating a record for a new 1/1 module

    Firstly, I am new to SugarCRM. (that's the excuse out of the way!).
    I have created a simple test module "Certificates" with a drop down list box containing a test field (drop down list box)..
    This test module is a 1/1 with the Contact.
    Having deployed the module, I find a contact and I see that at the bottom of the contact display a new line added that looks like this and for some reason the line is present twice and has a generated name as the label:

    anyway,
    I click on the Select button and get a popup that looks like this - but no ability actually create a new "Certificate" record:

    I would appreciate any help in telling me
    (a) why is the line present twice in the Contact display
    (b) why the display label is as it is and how do I provide a more user friendly label.
    (c) How do I go about actually creating a new record for this new test module?

    I'm obviously doing some daft but not sure what..
    Last edited by Socal; 2010-07-08 at 01:24 AM.

  2. #2
    datasponge is offline Sugar Community Member
    Join Date
    Mar 2008
    Location
    San Jose, CA, USA
    Posts
    553

    Default Re: Werd things with creating a record for a new 1/1 module

    Hi Socal,

    Not sure why on your questions, but I can make some guesses.

    The only reasons I can think of for the duplicate entry are:
    1. You added it twice to your layout
    2. You added the relationship twice in module builder

    Check Studio for the Contacts Module and see if it shows two relationships to Certificates or if Edit Layout shows the field added twice.

    The label should have been handled by Module Builder. I have seen instances where the label was not added to the opposite end of the relate - in this case Contacts. So check Studio for the Contacts module and see if there is a label for the relate field defined in that module. It has to be defined in both the Contacts module language file and the Certificates module language file separately.

    I also seem to recall that you can also over-ride the label in the Edit Layout, so look there as well if you don't find anything in the Studio Contacts labels. If that doesn't work, it's fairly easy to add manually as an Extension.

    On the create, I have not done exactly what you are doing, but whenever I have seen similar scenarios, the create button was added to the Select form. Not sure.

    This is quite inconvenient, but you can always add a tab for the Certificates module and create a record from there, then relate it by selecting a Contact. Then your dealing with a Contact that should always be there to select.

    Phil


    Quote Originally Posted by Socal View Post
    Firstly, I am new to SugarCRM. (that's the excuse out of the way!).
    I have created a simple test module "Certificates" with a drop down list box containing a test field (drop down list box)..
    This test module is a 1/1 with the Contact.
    Having deployed the module, I find a contact and I see that at the bottom of the contact display a new line added that looks like this and for some reason the line is present twice and has a generated name as the label:

    anyway,
    I click on the Select button and get a popup that looks like this - but no ability actually create a new "Certificate" record:

    I would appreciate any help in telling me
    (a) why is the line present twice in the Contact display
    (b) why the display label is as it is and how do I provide a more user friendly label.
    (c) How do I go about actually creating a new record for this new test module?

    I'm obviously doing some daft but not sure what..

  3. #3
    Socal is offline Member
    Join Date
    Jun 2010
    Posts
    18

    Question Re: Werd things with creating a record for a new 1/1 module

    datasponge,
    I did some further investigation into this and create a totally new module comprising of nothing other than a drop down and this time the correct label was applied but again the 2 rows were present - definitely only 1 single relationship exists. I think this is being caused by the fact that I only have a single field and that it is a drop down list box type field.
    I then went back into Module Builder and added a second field - a Text field and redeployed.
    This time only 1 row was displayed at the bottom of the contact form - so some progress there.
    However, editing the Contact and "selecting" the new module caused the Selection popup window to appear but still no "Create" button is being displayed.

    I see that when clicking the Select button next to Campaigns in the Contact data that it too does not display a Create option. in the popup window.
    Yet other fields that have the Select button do indeed show the Create button in the popup window.

    So this seems to be handled internally by some code.. but where and how - I do not know.

    For info I am running SugarCRM V5.5.4 and my test module was created using the 'Basic' template.

    Any help on why the "Create button is not being made available is greatly welcome. I created the new module initially using Module Builder - so this may perhaps be some 'limitation' of using MB?

    It appears that somebody previously posted the same question regarding getthing this into a custom module but did not get a solution
    http://www.sugarcrm.com/forums/showthread.php?t=61574


    Her is the current screenprint - No Create button....
    Last edited by Socal; 2010-07-09 at 02:00 AM.

  4. #4
    davidboris is offline Sugar Community Member
    Join Date
    May 2010
    Posts
    1,113

    Default Re: Werd things with creating a record for a new 1/1 module

    Hi,

    You have to add these lines in popupdefs.php

    PHP Code:
    'create' =>
           array(
    'formBase' => 'SINGULAR_MODULE_NAMEFormBase.php',
             
    'formBaseClass' => 'SINGULAR_MODULE_NAMEFormBase',
             
    'getFormBodyParams' => array('','','SINGULAR_MODULE_NAMESave'),
             
    'createButton' => $mod_strings['LNK_NEW_SINGULAR_MODULE_NAME']   
              ), 
    If, you have used module type as "Person", you can follow the code of ContactFormBase.php, follow function getFormBody.
    Thumbs up.

    Skype ID - david__boris

    SugarForge Projects:

    WYSIWYG now in studio!(Version 1.1 is out now!)

    Sugar Feeds on your personalized home pages like iGoogle, My Yahoo!, etc.

    Fab Tools! > Dashlet Not Followed Opportunities for past six Months

  5. #5
    Socal is offline Member
    Join Date
    Jun 2010
    Posts
    18

    Thumbs up Re: Werd things with creating a record for a new 1/1 module

    david thanks.
    I created my module using the "basic" template.

    I will take a look at what you pointed me at.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 15
    Last Post: 2010-04-01, 04:04 PM
  2. Replies: 5
    Last Post: 2010-03-30, 01:58 PM
  3. Creating Record in Sub-Panel
    By jpweb in forum Developer Help
    Replies: 0
    Last Post: 2009-11-28, 03:19 PM
  4. Replies: 2
    Last Post: 2009-04-08, 08:45 PM
  5. send a dynamic value when creating a new record
    By meeric in forum Developer Help
    Replies: 1
    Last Post: 2008-10-09, 09:50 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
  •