Tech Tip Thursday: Using Relationship Forms

aras-plm-tech-tip-thursdays

Relationship forms allow you to extend the amount of information captured about an item in a relationship tab. They are particularly useful when the main item has many property/fields, or if section properties need to be displayed by type using relationship tabs.

The following example will show you the ins and outs of relationship forms. It uses a Help Ticket item that captures and displays Company information about the item on a Company tab.

This week's Tech Tip Thursday is geared toward our tech-savvy readers. The language and intent is for those with a technical understanding of Aras Innovator vs a business perspective. In other words, don't try this in production or without adult supervision!

 


aras-plm-tech-tip-thursdays

  1. Create a new form to be used by the relationship tab control. The name (not Data Source) of each field element on the form must be the same name as a property on the parent item (to store the value on the main item).

    For example: a string property named company_name is created on the Help Ticket item to refer to the field element company_name on the form as shown below.

  2. aras-plm-tech-tip-thursdays

  3. Create the following Client Side JavaScript Method named TabFormFieldChanged:
  4. var field_name = this.name;
    var property_value = this.value;
    document.thisItem.setProperty(field_name, property_value);
    
    
  5. Create the following Client Side JavaScript Method named TabFormPopulateFields:
  6. 
    for(i=0; i<document.forms(0).elements.length; i++)
    {
      var e = document.forms(0).elements[i];
    
      if (e.name == "" | e.name==undefined) {
       	//these are internal properties - do nothing
      }
      else {
       	//get value of property from parent item
    		e.value = document.thisItem.getProperty(e.name,	"");
      	}
      }
    
  7. Attach the TabFormFieldChanged Method to the onChange event of each tab form field that will have data entered/changed by a user:
  8. aras-plm-tech-tip-thursdays

     

  9. Attach the TabFormPopulateFields Method to the onFormPopulated tab Form Event:
  10. aras-plm-tech-tip-thursdays

     

  11. Establish a relationship between the parent item and a related item. The actual relationship to the related item will not be used but the RelationshipType template is needed to modify the tab view. In this example, a relationship is established from the Help Ticket and named Help Ticket Company. (You can also use a "NULL" relationship if you prefer.)
  12. aras-plm-tech-tip-thursdays

     

  13. Edit the RelationshipType template created from the previous step and modify the Relationship View to use a form. In this example, a form named Company is used for the tab view rather than the standard relationship grid.
  14. aras-plm-tech-tip-thursdays

     

  15. As a user enters data into a tab form, the corresponding properties are set on the parent item. When the item is saved, all data is captured in a single transaction to the main item.
  16. aras-plm-tech-tip-thursdays

Of course, this is just the tip of the iceberg on utilizing relationship forms. Tell us about one of the ways you’ve utilized this or share an idea for a future Tech Tip Thursday. Leave your feedback, tweet me @plmjen or send a message to info@aras.com.


Posted Thu, Oct 18 2012 9:07 AM by Jennifer

Comments

PLM Blog - Aras Innovator Technology wrote Top Tech Tips of 2012
on Thu, Dec 27 2012 10:09 AM

Wow. Can you believe it’s the last Thursday of 2012? This year has flown by and we have covered