I have an event (onSearchDialog) within a property from a Relationship Type. How do i get a value from the relationship properties for the row selected.

I have an event (onSearchDialog) within a property from a Relationship Type. How do i get a value from the relationship properties for the row selected.

The method I have now only works on getting a value from the parent.

var sid = top.thisItem.getPropertyAttribute("customer","keyed_name");
var retObj = new Object();
retObj["customer_sid"] = { filterValue: sid, isFilterFixed: true };
return retObj;

Parents
  • Hi 

    Not sure exactly this is what you are looking for but give a try

    //In this below case, Part BOM is my relationship, customer is a property in Part BOM relationship and this method is attached to on search dialog event

    var relID = inArgs.itemSelectedID;
    var retObj = new Object();
    if (relID)
    {
    var customerItem = this.newItem("Part BOM", "get");
    customerItem.setID(relID);
    customerItem.setAttribute('select','customer')
    customerItem = customerItem.apply();
    if (!customerItem.isError())
    {
    var sid = customerItem.getProperty("customer", "");
    if (sid)
    {
    retObj["customer_sid"] = {filterValue: sid, isFilterFixed: true};
    }
    }
    }


    Thanks

    Gopikrishnan R

Reply
  • Hi 

    Not sure exactly this is what you are looking for but give a try

    //In this below case, Part BOM is my relationship, customer is a property in Part BOM relationship and this method is attached to on search dialog event

    var relID = inArgs.itemSelectedID;
    var retObj = new Object();
    if (relID)
    {
    var customerItem = this.newItem("Part BOM", "get");
    customerItem.setID(relID);
    customerItem.setAttribute('select','customer')
    customerItem = customerItem.apply();
    if (!customerItem.isError())
    {
    var sid = customerItem.getProperty("customer", "");
    if (sid)
    {
    retObj["customer_sid"] = {filterValue: sid, isFilterFixed: true};
    }
    }
    }


    Thanks

    Gopikrishnan R

Children