0 Replies Latest reply on Oct 6, 2011 8:09 AM by 747489

    Web Applet: asset related on parent asset


      I managed to create a web applet in order to create a parent - child relationship for Tasks using the following code:

      <script type="text/javascript" id="customJavaScript">
      var Div_id = document.getElementById("customJavaScript").parentNode.id;
      var endIndex = Div_id.indexOf("Div");
      if(endIndex>0) {
      var Title_id = Div_id.substring(0, endIndex) + "_Title";
      var Title_obj = document.getElementById(Title_id);
      var newTD = document.createElement('td');
      newTD.innerHTML = "<div
      Short Text
      To+Do',false, this, null);\" onmouseover=\"toggleNavButton(this);\"
      onmouseout=\"toggleNavButton(this);\" onkeypress=\"onButtonPress(this);\"
      class=\"buttonChildTitleBarTD\" id=\"OpenActivitiesTB31607487*1\">&#160;New Related
      Title_obj.parentNode.insertBefore(newTD, Title_obj.nextSibling );

      The child was associated to the parent based on a custom field named Related Activity ID (Indexed Short Text 0).

      Can anyone help me customize this code in order to make it work for Assets related on parent Assets based on the Related Asset ID custom field (ZText_30)?

      Thank you!