I was recently tasked with creating a series of editable SmartForm views based on some that already existed elsewhere in the application. One of the views was based on a SmartObject that contained a series of ID’s pointing to other database tables. The task was to have the list view list the text of the records the ID’s pointed to — not the actual ID’s. Makes sense – to display a value of “1” probably isn’t going to mean anything to the user, but a value of “ALL” will.
Doing this in the list view is the job of the List Display control. The List Display lets one configure the relationship between the SmartObject value and another value in a different SmartObject.
I had thought that my task should be relatively easy — save the original view as the view I was creating, change a little wiring, and I’d be good to go. Not so. For reasons I don’t understand, I simply could NOT make the the properties of my “new version” of the old list view resemble what I needed for the List Display to work.
In my case, it was just easier to start over.
And I found that starting over was exactly what I needed — everything fell in line effortlessly — so much so that I’m a little mad at myself for spending so much time yesterday on trying to make my former approach work.
All to your benefit — because I’m about to walk you through using a List Display object in an editable SmartForms View.
- Start with identifying the SmartObject upon which to base your new view.
- Create a new View. Name it, assign it a category, and identify it’s type as a List View, and assign that SmartObject as the data source. Finally, click the Next button at lower right.
- In the layout screen, click on the Create Labels and Controls link at center.
- In the panel that pops up, include the fields needed in the layout. Under Edit Options, be sure to enable list editing if needed, and, under Additional, check the box if you wish to allow the user to manually refresh the list. Click the Next button at lower right.
- I’m going to pick one column in particular — User Id. Click on the column to reveal its properties. You should be able to see, in the Properties form at right, that is set by default as a Data Label control. The control properties point to a SmartObject field and reflects the field’s data type (Number).
- Click on the Change Control icon in the horizontal navigation above the layout, and change the control from Data Label to List Display.
- The properties form for the column should now include a section called Data Source, that was not present when the control was a Data Label.
- The top control in the Data Source section of the Properties panel should be the SmartObject. The control appears to be a textbox followed by a button showing an ellipsis (“…”). The value in the field should currently read “(None)”. Click the ellipsis to bring up the Configure Data Source form.
- In the Configure Data Source popup, select the SmartObject to which the column should refer. You might find the rest of the fields will populate themselves for you — in my case, the Method field set itself to List, the Value field set itself to “Id” (matching the ID value coming from the SmartObject upon which the View is based), and it set the Display value to [Name], which is exactly what I wanted. Click OK to close the popup. You should see some of the other values in the Data Source region of the Properties panel are now populated.
- Save, Finish, and Run your view. You should see that the data for the column you edited shows the text associated with the ID populated in that data column.
You must be logged in to post a comment.