Not getting selected item in search dialog box

Hello,

I have a Document relationship on Part ItemType. I have added a method on "OnBeforeNew" client event of that relationship. When I add a new relationship from the form a search dialog box gets open and it shows me all the Document item present in the system. When I select the item in search dialog box and click on the green color tick on the top right, I get the details such as id and name etc in my method but when I double click the item in search dialog box then I dont get the item details in my method.

window.parent.findCurrentRelationshipsTab().itm - This is the line of code which gives me null value when I double clicks the row in search dialog.

Please sugggest me how to get the selected item search dialog box.

Parents Reply
  • My use case is getting selected Documents data ( Such as Doc No, id) in the Search Pop up dailog in a client method which is hooked to OnBeforeNew Client events of the Part Document Relationship Itemtype. 

    After getting the data, i will add some validation code.

Children
  • var documentItems = aras.itemsCache.getItemsByXPath("//Item[@type='Document']");
    for (var i = 0; i < documentItems.length; i++)
    {
    var documentId = documentItems[i].id;
    var inn = this.getInnovator();
    var documentItem = inn.newItem('Document','get');
    documentItem.setID(documentId);
    documentItem = documentItem.apply();
    if(documentItem.isError())
    {
    return aras.AlertError(documentItem.getErrorString());
    }
    if(documentItem.getProperty("state") == "Preliminary")
    {
    aras.AlertError("Preliminary cannot be added.");
    return false;
    }
    }