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 (docapply.no) 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.itemsCache.addItem(tmpItem);
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)
{
top.document.frames[2].iframesCollection[tabID].contentWindow.location.reload();
}