Main Views

Since SLX 6.2, the Account, Contact, and Opportunity entities have been implemented as Main Views.

If you want to create your own custom Main View (e.g., for hospital Cases, or company Projects) entity, these are the steps:

  1. In the Picklist Manager, on the Plugin Families tab, add a “MyEntity” value to the Active Form Types, Active Script Types, Main View Types, Menu Types, Report Families, and Toolbar Types picklists
  2. Create a new table (e.g., MyEntity), not associated with any other tables
  3. Create a new MyEntity Detail Main View, bound to the MyEntity table; set the EntityNamePlural and EntityNameSingular properties; and save it under the MyEntity plugin family
  4. Create an Insert New MyEntity Data Form, bound to the MyEntity table
  5. Create a MyEntity Details form, and assign it to the ViewName property of the DetailsView control, on the MyEntity Main View
  6. Create a new lookup (Manage -> Lookups) against the MyEntity table, to be used as the QuickFindLookup on the MyEntity Main View. (For lookups, the Search field is the field searched on, e.g., the field which the “Starting With” value is applied to; the LookupID is what it returns [e.g., to the LookupID field of a LookupEdit control], as an SLX Standard ID; and the Name field is “the value that would be displayed in a LookupEdit when the lookup returns [like a contact name, address info, etc.”])
  7. Create tabs for the Main View (tabs are just Data Forms, bound to the MyEntity table, with the default panel and buttons removed)
  8. Add those tabs to the DefaultTabs list property of the Main View TabsPane control
  9. On the Standard Menus plugin, add a new item to launch the Insert New MyEntity form
  10. In the Standard Menus plugin, create a new MyEntity NavMenu entry. (The OTB right-click popup items for the Sales Toolbar [!] can be found in the same Standard Menus plugin, below the main menu items; e.g., Contacts NavMenu)
  11. On the Sales Toolbar, add an item to jump to the MyEntity Main View (i.e., an Action value of Function, with an Argument of MyEntity:MyEntity Detail). Set its Popup menu property to the MyEntity NavMenu
  12. On the Standard Toolbar, add a new item (with icon) to Insert New MyEntity, which launches the MyEntity:Insert New MyEntity form
  13. Add an item to the Lookup main menu (in the Standard Menu plugin) to launch your MyEntity lookup via a script, using the LookupItemWithConditionByID function (example)

You can’t change the bound-table for a Data Form after it’s created, so if you want to reproduce the normal Attachments or Contacts tabs for the MyEntity entity, you can’t just save them under the new Family. What you’ll have to do instead is create a new Data Form, bound to the MyEntity table, and then copy-and-paste the code and the controls from the existing OTB tab, onto your new one.

In 7.5, the Activities tab (and also the Summary tab) are still part of the compiled functionality of SLX; so if you want to have an Activities tab for the MyEntity entity, you’ll have to build it from scratch.

Of course, if you’re associating Activities with MyEntity records, you’ll also need to modify the Activity Detail View form, and add a MyEntityID field to the Activity table, data-bound from the Activity Detail View. You can do a similar thing for the MyEntity Notes/History tab, adding the MyEntityID field to the History table.

If your MyEntity Main View is displaying “%n of %n records” at the top, or if the All MyEntities group in the (F8) groups view contains no records, check to make sure that your lookup has been assigned to the QuickFindLookup property of the Main View, that it exists on the database in question (i.e., if you’re in QA or production, it should have been bundled and applied), and doesn’t include fields which don’t exist in the MyEntity table.

Also, for the menu/toolbar additions above, it’s much preferable to do those in new plugins, which simply add/remove options from the OTB Standard Menu, Standard Toolbar, and Sales Toolbar. That way, when it comes time to upgrade to the next version, you don’t have to search through the OTB menus/toolbars to try and figure out what you’ve added or deleted from them.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: