Thursday, 26 September 2013

Dropdown values in customCode

Greetings from Urdhva Tech!

Came across an interesting question which led me to check and write a blog post.

Q: Translate enum value to display in customCode [Forum post]

A: It is a two step solution.

Step 1: Create / Edit custom/modules/Accounts/view.detail.php add following code in function display.

function display(){       
         global $app_list_strings;
         $this->ss->assign('APP_LIST', $app_list_strings);

         // ......
         // ......
         echo $this->dv->display();
}


Step 2: Taking an example of Accounts module, fields, account_type and industry.

'customCode' => '{$APP_LIST.account_type_dom[$fields.account_type.value]}  {$APP_LIST.industry_dom[{$fields.industry.value}]}',

Where account_type_dom = options for field account_type and so on.

Do Quick Repair and Rebuild!

Comments welcome.

Hope that helps. 


No comments:

Post a Comment

Urdhva Tech Pvt. Ltd. Powered by Blogger.

Urdhva Tech

My photo
SugarCRM Consultants Contact us at contact@urdhva-tech.com Skype : urdhvatech

Search This Blog

Stay connected Socially

     

Total Pageviews

Popular Posts