populate defaul property via javeascript

When i create a new item via a relationship called Subcontract, there is a property called MASTER_DID on subcontact which is datatype item as well, when the user selects a MASTER_DID the owner of MASTER_DID  should auto populate with the owner of Subcontract. This needs to all happen on the grid. How can i achieve that via client event

Parents
  • Without image the question is a little bit hard to understand

    But maybe you could use a "onAfterNew" Client Event in your ItemType. E.g. check out Method 'PE_SetOriginator". This one is used very often to set the owner property automatically.

  • So im trying the following added code on the property itself, oneditfinish event and i will get the following error

     var SDRLMDID = document.thisItem.getProperty("vsy_did_master",""); 
     var SDID = this.getInnovator().getItemById("Supplier DID", SDRLMDID);
     if (SDID.getItemCount()==1)
        {
            this.setProperty("vsy_first_delivery", SDID.getAttribute("id"));
          this.setPropertyAttribute("vsy_first_delivery", "keyed_name", SDID.getProperty("keyed_name", ""));
        }

Reply
  • So im trying the following added code on the property itself, oneditfinish event and i will get the following error

     var SDRLMDID = document.thisItem.getProperty("vsy_did_master",""); 
     var SDID = this.getInnovator().getItemById("Supplier DID", SDRLMDID);
     if (SDID.getItemCount()==1)
        {
            this.setProperty("vsy_first_delivery", SDID.getAttribute("id"));
          this.setPropertyAttribute("vsy_first_delivery", "keyed_name", SDID.getProperty("keyed_name", ""));
        }

Children