Custom Field URL

Hi ,I want to add a custom field to lead. Its a URL field but I want to show user friendly link in the list view/details view instead of raw URL. When I create custom URL field, it shows raw URL. Any suggestion on how to achieve this?

URL shows like this
Lead Name Profile_Link
John. https://www.linkedin.com/in/johnxyx

I would like something like this
Lead Name Profile_Link
John. John_linked_in

1 Like

I don’t think you can do this out-of-the-box.

But you can try entering the data in this format, to see if it works

<a href="www.site.com">Link text!</a>

If it doesn’t work, you’ll need a PHP customization. Either a custom filed type, which is more complicated, or simply customizing the list view, like in this example:

http://www.jsmackin.co.uk/suitecrm/suitecrm-list-view-conditional-formatting/

1 Like

@pgr, thanks for quick response and suggestion. just adding content as HTML will not help as while rendering it gets encoded and you will see raw HTML.
So I implemented as you suggested via simple logic hook, my content was already a proper link, the only thing I need to do in a logic hook is decode the content.

Added a logic hook for lead in

 /custom/Extension/modules/Leads/Ext/LogicHooks/ListViewLeads.php
    <?php
    $hook_array['process_record'][] = Array(1, 'Leads List View', 'custom/modules/Leads/AdURLLogicHook.php','AdURLLogicHook', 'AdURL');
    ?>

Logic hook in custom/modules/Leads/AdURLLogicHook.php

  <?php
  class AdURLLogicHook{

      public function AdURL(SugarBean $bean, $event, $arguments){
           
          $bean->ad_link_c = html_entity_decode($bean->ad_link_c);
      }

  }

Worked like a charm!! Thanks again.

1 Like

Hi @rahulner

I was trying to do the same as you. The url I am generating is massive (using severl url parameters) and in a list this is a nightmare. I’d like to have the link working but with a small word. Could even be “Link”, but using the dinamically generated url from the url field.

However, I could not reproduce your solution, but it might be that I am doing something wrong, especially because this is custom module, built using the module builder.

Do you have any suggestion?

My module is installed and visible in modules as “Classified_Ads”. The url field is called “link_agendamento”, but I am a bit lost on how to implement this.

Thanks for the help.