0 Replies Latest reply: Oct 6, 2011 3:09 AM by 747489 RSS

    Web Applet: asset related on parent asset

    747489
      Hello,

      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
      onclick=\"doNavigate('TaskNew?OMTGT=TaskEditForm&OMTHD=ActivityNewNav&TaskEditForm.Indexed
      Short Text
      0=%%%Id%%%&TaskEditForm.Type=To+Do&OMRET0=TaskDetail%3fOMTGT%3dTaskDetailForm%26OMT
      HD%3dActivityDetailNav%26OCTYPE%3d%%%Type%%%%26TaskDetailForm.Id%3d%%%Id%%%&OCTYPE=
      To+Do',false, this, null);\" onmouseover=\"toggleNavButton(this);\"
      onmouseout=\"toggleNavButton(this);\" onkeypress=\"onButtonPress(this);\"
      class=\"buttonChildTitleBarTD\" id=\"OpenActivitiesTB31607487*1\">&#160;New Related
      Task&#160;</div>";
      Title_obj.parentNode.insertBefore(newTD, Title_obj.nextSibling );
      }
      </script>


      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!