06-25-2010 07:07 AM
I create new tables and associated new entity types every-so-often. The tables are usually one-to-one to an existing entity type (like Account). The new entities are marked to extend the same existing entity type. Then, under the existing entity node (FORMS folder), I create a new form containing fields from the new entity. I then add it as a SMART PART to an existing details page. After deployment, the new form shows up as a new tab under its associated details page. This process usually works successfully. When the user clicks SAVE on the main details page, the associated data in the new tab gets saved too.
However, if I create the new form under the brand new entity itself (in the FORMS folder), and then add it as a SMART PART, it doesn’t seem to cascade the SAVE functionality when someone clicks SAVE on the details page. I’d much rather create new forms under the new entity, and associate it as a smart part to an existing entity…. rather than having a ton of forms under the existing entity’s FORMS folder.
Am I making sense?
Thank you for any help in advance.
06-27-2010 04:01 PM
06-28-2010 06:35 AM
I add the one-to-one tables because I like the logistical seperation between the out-of-the-box root entity fields, and the new fields/table. Conceptually, it's the same issue I have with creating the form at the root level too.
For instance, we do some data collection (market research) on Accounts all dealing around a specific issue (say "cost of product"). Sometimes, this requires 20 new fields. Each of those fields directlying relating to "cost of product". I'd prefer not to create those 20 new fields as additional columns in the main Account table.
06-28-2010 09:52 AM - edited 06-28-2010 09:54 AM
07-02-2010 05:39 AM
The reason that the smart part needs to be created under the root entity is to ensure that the binding context is correct. You are right that If you create it as its own entity the association would not directly be created. You would explicitly have to create that relationship before the save as it would not be easy to define your intent. This is also why grids and other smartparts are hosted underneath the parent entity and not the targeted entity (context).