Results 1 to 6 of 6

Thread: assign primary field in custom module

  1. #1
    chris.marsden is offline Sugar Community Member
    Join Date
    Sep 2011
    Posts
    57

    Default assign primary field in custom module

    This is probably a common question but i have added a new module and want to be able to go to a record by clicking a field i have created

    just like in accounts you would click the business name.

    i will attach a screen shot if needed as im not sure how well i have explained that.

    thanks in advance

  2. #2
    sts's Avatar
    sts
    sts is offline Sugar Community Member
    Join Date
    Aug 2010
    Posts
    978

    Default Re: assign primary field in custom module

    I'm not sure if I understand your question fully right.

    You can jump to an object in Sugar with creating a link with an URL like this:
    <your base path>/index.php?module=Accounts&return_module=Accounts&a ction=DetailView&record=00120000003PvBDAA0

    'module' is the type of object you want to see, here in my example I want to see an account.
    'return_module' is the module where you want to go back after viewing the record.
    'action' in my example is DetailView because I want to see this view. Here I could take the EditView too.
    'record' is the id of the object.

    There are some other params possible, but these are the most common. Just take a look at the URL in your browser if you have a record open ...
    Stefan Ulrich Sauer
    System Analyst

    Devoteam Danet GmbH
    Gutenbergstraße 10
    D-64331 Weiterstadt
    Germany
    email: Stefan-Ulrich.Sauer@devoteam.com
    http://www.devoteam.de

  3. #3
    chris.marsden is offline Sugar Community Member
    Join Date
    Sep 2011
    Posts
    57

    Default Re: assign primary field in custom module

    i have attached a SS -

    I basicly want the MPAN/MPR to allow me to veiw the record via hyperlink, the above fix wouldnt work as the record would change each time for each MPAN.
    Attached Images Attached Images  

  4. #4
    sts's Avatar
    sts
    sts is offline Sugar Community Member
    Join Date
    Aug 2010
    Posts
    978

    Default Re: assign primary field in custom module

    Yes, the id in 'record' must have the proper value for each record (which will be different for each record off course).

    In listviewdefs.php for example you could set something like this (I'm not sure with the exact syntax)

    'customCode' => '<a href="index.php?module=Accounts&return_module=Acco unts&action=DetailView&record={$fields.id.value}"> {$fields.name.value}</a>',

    (id and name are two fields in your module)
    Stefan Ulrich Sauer
    System Analyst

    Devoteam Danet GmbH
    Gutenbergstraße 10
    D-64331 Weiterstadt
    Germany
    email: Stefan-Ulrich.Sauer@devoteam.com
    http://www.devoteam.de

  5. #5
    chris.marsden is offline Sugar Community Member
    Join Date
    Sep 2011
    Posts
    57

    Default Re: assign primary field in custom module

    Quote Originally Posted by sts View Post
    Yes, the id in 'record' must have the proper value for each record (which will be different for each record off course).

    In listviewdefs.php for example you could set something like this (I'm not sure with the exact syntax)

    'customCode' => '<a href="index.php?module=Accounts&return_module=Acco unts&action=DetailView&record={$fields.id.value}"> {$fields.name.value}</a>',

    (id and name are two fields in your module)

    I am unsure as to what to use for ID and Field and which way round these would go... stupid question but please help lol

    would i also need: 'link' => true, in list vardefs file?

  6. #6
    chris.marsden is offline Sugar Community Member
    Join Date
    Sep 2011
    Posts
    57

    Default Re: assign primary field in custom module

    in the listvardefs file i have added the link section:
    'MPAN_CORE_C' =>
    array (
    'type' => 'varchar',
    'default' => true,
    'link' => true,
    'label' => 'LBL_MPAN_CORE',
    'width' => '10%',
    ),

    it gives the desired effect in the index of that module, how do i get this to happen within another modules subpanel now???
    Attached Images Attached Images  

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 4
    Last Post: 2010-03-24, 04:59 PM
  2. Replies: 11
    Last Post: 2009-08-16, 09:39 PM
  3. How to hyperlink Assign To field in Accounts Module
    By rraushan2007 in forum Feature Requests
    Replies: 4
    Last Post: 2008-08-22, 01:05 PM
  4. Replies: 0
    Last Post: 2007-01-04, 09:44 AM
  5. Primary Key ID field duplicate entry upon import
    By andrewstuart in forum Help
    Replies: 1
    Last Post: 2005-04-04, 07:45 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
  •