Generate an address by a Contact Field

Hello, first of all i’d like to say good job with the development of his awesome CRM.

My issue is the following: i need to generate an HTTP address involving the value of the Contact Field i’m looking right now. Specifically, I have a code which is a string value. I need to take the first 11 letters of it and pass to an address thats like http://address.com&=code. I’d like to show this generated address in the Detail View of each contact.

Any help is appreciated.

Hi,
If i am not wrong. Create a new url field called XYZ.
Then write a logic hook and save your address in the url field XYZ .

example:
Contact field=ABCD.
XYZ=http://address.com&=ABCD.

Now u click the url u get the response.

Cheers.

Hello arshath,

thanks for the comment.
I’m pretty new in Logic Hooks and I tried the following:

logic_hooks.php

<?php
// Do not store anything in this file that is not part of the array or the hook version.  This file will	
// be automatically rebuilt in the future. 
 $hook_version = 1; 
$hook_array = Array(); 
// position, file, function 
$hook_array['before_save'] = Array(); 
$hook_array['before_save'][] = Array(1, 'Contacts push feed', 'modules/Contacts/SugarFeeds/ContactFeed.php','ContactFeed', 'pushFeed'); 
$hook_array['before_save'][] = Array(77, 'updateGeocodeInfo', 'modules/Contacts/ContactsJjwg_MapsLogicHook.php','ContactsJjwg_MapsLogicHook', 'updateGeocodeInfo'); 
$hook_array['after_save'] = Array(); 
$hook_array['after_save'][] = Array(1, 'Update Portal', 'modules/Contacts/updatePortal.php','updatePortal', 'updateUser'); 
$hook_array['after_save'][] = Array(77, 'updateRelatedMeetingsGeocodeInfo', 'modules/Contacts/ContactsJjwg_MapsLogicHook.php','ContactsJjwg_MapsLogicHook', 'updateRelatedMeetingsGeocodeInfo'); 
$hook_array['after_retrieve'] = Array();
$hook_array['after_retrieve'][] = Array(1, 'Update Radius Address', 'custom/modules/Contacts/RadiusLogicHook.php', 'RadiusLogicHook', 'updateRadius'); 

my RadiusLogicHook.php:


class RadiusLogicHook
2 {
3 function updateRadius($bean, $event, $arguments)
4 {
            $rest = substr($bean->code_c, 11);
6 			$bean->radius_c = 'http://address.com'.$rest;
   }
7 }

unfortunately, this brought me to an error when accessing any Contact record:

“There was an error processing your request, please try again at a later time.”

What can I do?
Thanks for the response

edit: solved, everything is working fine now. Thanks for the help.