Dropdown values in customCode

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

Translate enum value to display in customCode

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!

Hope you find this blog post helpful.

Feel free to add comments and queries, that helps us to improve the quality of posts.

You can contact us at info@infotechbuddies.com

Thank you.

Spread the love

Leave a Reply

Your email address will not be published. Required fields are marked *