How to refresh or reload the relationship tab

Hi, All.
I have a Itemtype (source) named DocApply.
DocApply has a relationship called DocApply_deplist which connects DocApply to DocApply_dep (related).
I added an onchange event to DocApply's property (no) to bring the related data to DocApply_dep when (no) is changed.
The problem I encounter now is as follows

DocApply_dep has a field with the dep_name data type of Item
When I successfully write the data into DocApply_dep, but the dep_name of the relationship tab on the screen is blank, I want her label to be displayed, but I don't know how to do it, can anyone suggest me?

//Here is the javascript code I wrote
//It is executed in ( onchange event

var tabbar = parent.relationships.relTabbar;
      tabID = tabbar.GetTabId("部門會簽");
var currTabID = parent.relationships.currTabID;
var FirstTabID = tabbar.GetTabId("Signoffs");

var tmpItem;
var DocApply_depRelId = top.aras.getItemFromServerByName("RelationshipType","DocApply_deplist","id").node.getAttribute('id');

var dep = "gm,ap,ep,sw,rd,hpla,po,ee,pa,cm,ed,lm,tt,pt,ad_mm,qc,ms_1,it,ad,hr,fa,fc"

if (srcElement.value !== "")
   var qcondition = "<itemtype>Arima_ECR_ECN</itemtype><id>"+ECNid+"</id><dep>"+dep+"</dep>";
   var Depinfo = top.aras.applyMethod("Find_Old_CountersignDep", qcondition);
   Depinfo = Depinfo.replace("<Result>","");
   Depinfo = Depinfo.replace("</Result>","");
   //return-> id:keyed_name,id:keyed_name,...

   var Dep_data = Depinfo.split(",");
   for (var i = 0;i<Dep_data.length ; i++)
      var Dep_info = Dep_data[i].split(":");

      tmpItem = top.aras.newItem("DocApply_dep");
      top.aras.setItemProperty(tmpItem,"dep_name",Dep_info[0]); // id

      var newRelship = top.aras.newRelationship(DocApply_depRelId,parent.item,false,null,tmpItem,"DocApply_dep",false,true,"DocApply_deplist");


if (currTabID !== FirstTabID)

  • If somebody knows and can help I would really appreciate that.

    I also tried the following four ways to update and reload,

    but I don't know if it's the wrong way to use it,

    it didn't work for me either, there will be an error message



    var parentItm = document.thisItem;
    var parentID = document.itemID;
    var parentAction = 'view'; // or 'view'

    if (currTabID !== FirstTabID)

    if (aras.getMostTopWindowWithAras(window).frames.relationships)
    {// check "no tabs in tab view"
       var iFramesCollection = aras.getMostTopWindowWithAras(window).frames.relationships.iframesCollection;
       for (var tbId in iFramesCollection)
          var relshipTypeNd = aras.getRelationshipType(tbId);
          var relshipTypeName = aras.getItemProperty(relshipTypeNd.node, "name");
          if(relshipTypeName === "DocApply_deplist") {

    Can anyone tell me the correct way to use it and the timing?