How to create a Table View out of multiple fields on a single record.

  • 1
  • Question
  • Updated 4 years ago
  • Answered

I need to arrange multiple accounting type fields which all reside on a single record into multiple rows and columns of a table.

Billing Code, Start Date, End Date, Monthly Units, Annual Units, Rate

Billing Code2, Start Date, End Date, Monthly Units, Annual Units, Rate

Billing Code3Start Date, End Date, Monthly Units, Annual Units, Rate

The problem I am running into is that all the fields are located on a "Service Contract Table".  I tried using the "Field Editor using multiple columns but I do not want the field names to show up in the table because it takes up too much room.

Any suggestions to arrange Object/Record Fields into a table like view?  It may be better to create an Object called "Service Contract" with a Master Detail Relationship to "Billing Codes"?  But since we are limited in how many objects we can use I am trying to use one object to accomplish both.

Thank you


Photo of Rich Slack

Rich Slack

  • 4,134 Points 4k badge 2x thumb

Posted 5 years ago

  • 1
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
You can replicate the effect you are looking to achieve.   Use the field editor component.   
Set the Field Layout property to be "Label above Field" 
Use the Section Titles to create your Column Headers (They are template fields if you need to create a data driven header).
Drag your fields into the columns.  Then add a "space" to the custom lable section of the field properties.  This will actually make the label section colapse.   If this is done on all fields you will a "Table like" alignment. 

If you need hard coded row titles - you can add template fields to that column.    Below is my finished product: 



Photo of Rich Slack

Rich Slack

  • 4,134 Points 4k badge 2x thumb
This works really well, however some of my fields do not have data in them so by the time it gets to the bottom of the page the rows are misaligned.  Is there a way to force all rows to have the same height regardless of content? 

For example, in your example if there were a few more rows and column 2 "Salesforce.com" and "True Love" were blank it would look like "Needs analysis was in Code 2's row.

Thank you for the continued help.
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
Its been a while since Rich asked this follow up question.  Sorry for the delay.   There are two options for handling the "no data" problem. 

1. You can override the CSS class for the rows to give them a specific Min Height. 
2. Or you can put all your data fields in templates with merge syntax that puts some placeholder text in rows with no data.  Somthing like this  
{{#FieldName}}{{FieldName}}{{/FieldName}}{{^FieldName}}Placeholder{{#FieldName}}
The presense of the placeholder will force the size to be correct. 

The operators in the merge syntax are  as follows. 

 # -- if there is data in Field name do what follows. 
^ -- if there is NO data in Field name do what follows. 
/ -- end the block of instructions in the current evaluation.

You can do some pretty powerful stuff nesting these "if then else" conditions.