This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

DEVELOPERS FORUM - Pass a PN on a Part Form to the DN on the Document Form

MMarcial - Monday, March 26, 2007 5:15 PM:

Is it possible to pass a "Part Number" on a Part form to the "Document Number" on the Document form?

This action would take place when the user edits a part, selects the Documents tab, selects "Create Related", then clicks the "New Relationship" icon.



SamsAn - Tuesday, March 27, 2007 7:17 AM:

Hi. 

1. Login as admin and select AdministrationForms in TOC.

2. Edit Document form.

  -> The form window appears.

3. Select Form Event tab in the window.

4. Add the new event (onLoad) to the tab with the method having the code below:

var partItm = document.item.selectSingleNode("ancestor::Item[@type='Part']");
if (partItm && document.isEditMode && document.item.getAttribute("action")=="add")
{
  var partNum = top.aras.getItemProperty(partItm, "item_number");
  if (handleItemChange) handleItemChange("item_number", partNum);
}

5. Enjoy: now Document Number equals to the parent Part Number when a new Document is created from Documents tab of a Part item.