Skip to main content

Posts

Showing posts with the label SugarCRM Dependant DropDown

SugarCRM : Programmatically Hiding and Displaying Panels Based on the Value of a Drop Down

Sugar Version: 5.1 Overview In many cases it is desirable to hide or show certain fields on a form based on the value of a field.   For example, if the account is a “partner” the form should show partnerish fields.   The easiest way to do this is to create panels with information specific to each record type and then hide or show the panels based on the record type. Step 1 – Rearrange the Edit and Detail Views Start with the edit view first.   From Studio, open the account edit view and create 2 panels. Name the first panel “CUSTOMER INFO” and the second panel “PARTNER INFO”.    The naming of these is very important because they will be used in the JavaScript code to hide these panels.   Drag some fields into both panels (See example below) Repeat the process for the detail view ensuring the panel names are the same. Creating a Custom Edit Handler Create a file called custom/modules/Accounts/views/view.edit.php.   This file is a custom edit view ...