AnsweredAssumed Answered

Show fields conditionally

Question asked by community-support on Jan 13, 2014
Latest reply on Jan 13, 2014 by community-support

I want to display fields based on the attributes of the object that is displayed. Or in more depth: I use the AOS_Invoices module for which I have created a drop down list to give an invoice one of 3 possible types (for the sake of the explaination let's call them A, B and C). Then I have created additional fields, which are relevant to only one of the types. So let's say I have created 6 additional fields. Fields 1 and 2 are relevant when invoice type A is selected. Fields 3 and 4 are relevant when invoice type B is selected. And 5 and 6 are for type C.

I have added to the line_items.js in order to display the correct fields in the editview. There the user might change the invoice type and the correct fields shall be visible without a page load. However, in the detail view, I want to display the correct fields directly. When I load the detail view the invoice has a type so I do know which fields to show - and this cannot change while the user is on the detail view.

I am using SugarCRM CE. Any idea how I can solve this?

Many thanks

(from petap)