Load Item on Aras Sidebar Button
Hello, I am new to Aras, I was trying to load a Item instance of different itemtype into part. I tried to follow sidebar_default_gv_click method and able to load the form. but the i am trying to load the item instance, which is not working. Below is the Html Page which is loding the form in view only mode and if I try to change it into edit mode it dosent work. <!doctype html> <!-- Modified version of ShowFormAsADialog.html for inline rendering --> <html> <head> <style type="text/css"> @import '../javascript/dojo/resources/dojo.css'; @import '../javascript/dijit/themes/claro/claro.css'; @import '../javascript/include.aspx?classes=common.css'; @import '../styles/common.min.css'; html, body { overflow: hidden; width: 100%; height: 100%; margin: 0px; padding: 0px; } </style> <script type="text/javascript" src="../javascript/include.aspx?classes=ArasModules,ScriptSet2"></script> <script type="text/javascript" src="../javascript/include.aspx?classes=/dojo.js" data-dojo-config="baseUrl:'../javascript/dojo'"></script> <script type="text/javascript"> function getQueryParam(name) { const match = location.search.match(new RegExp(name + '[:=]([^&]+)')); return match ? decodeURIComponent(match[1]) : null; } window.onload = function() { const aras = parent.aras || window.aras; // Try to get aras context const formId = getQueryParam('formid'); if (!formId || !aras) { document.body.innerHTML = "<center>Form not specified or ARAS context missing.</center>"; return; } const formNd = aras.getFormForDisplay(formId); if (!formNd) { document.body.innerHTML = "<center>Unable to load form metadata.</center>"; return; } const formFrame = document.getElementById('formFrame'); const win = formFrame.contentWindow; const item = null; const formType = 'view'; setTimeout(() => { aras.uiShowItemInFrameEx( win, null, // item.node if you have it formType, 0, formNd.node, null // itemTypeNd if required ); }, 100); }; </script> </head> <body class="claro"> <iframe height="100%" width="100%" id="formFrame" frameborder="0" scrolling="auto" src="blank.html"></iframe> </body> </html> Here I used item=null as aras.getItembyId(); is also not working. can someone help me with using aras.uiShowItemInFrameEx(); method because it is loding the form and this is the method through which I think i will be able to load Item Instance. Can anyone help me with how to load the form of diffrent itemtype through sidebar button?0Views0likes1CommentNeed to Hide few Columns in Part relationship BOM Tab
Hello Aras Experts, I have a business requirement related to the BOM (Bill of Materials) tab. In my current scenario, there is a need to hide specific columns, illustrated by the black-highlighted sections in the attached screenshot. Typically, to hide a column, one would navigate through ItemType -> Part -> Property -> and check the Hidden & Hidden2 values. However, in my case, these columns seem to be non-existent in this structure. I've also attempted to use JavaScript in the formload and formpopulated events to hide the columns, but unfortunately, this approach has not yielded the desired results. I would greatly appreciate any suggestions or guidance you can provide to address this issue. columns to hide - Transgroup, smallest pack, product type etc ( highlighted below) Regards, S. Senthurpari0Views0likes1CommentHow to hide/show columns of relationship on OnFormPopulate event
Hi All, I am trying to hide some of the columns from the relationship based on parent property value, I have tried below code: parent.findCurrentRelationshipsTab().grid.setColumnVisible(ColumnIndex, false, 150); however, this is working when Item is loaded, I want this on onFormPopulate. I am getting the parent.findCurrentRelationshipsTab().grid as null/empty. Is there any way to get the relationship grid. Thanks, Maddy1.1KViews0likes3CommentsHow 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 (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.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(); }5.3KViews0likes4CommentsHide Relationship Tabs based on Parent Classification Type
Hi All, Use case : On Part Item , based on the classification Type selected , the Part BoM relationship tab should be Hidden/Made Visible. I know it is now possible to hide tabs without using any custom code with the help of CUI , Refer : https://community.aras.com/b/english/posts/hiding-tabs-using-cui With the help of the same I was able to set the Tab Visibility based on the Item Type Classification : However , On Creation of the Part Item when the user selects the Classification Assembly , the CUI changes are not available, only when the user closes the Part and opens it again does the "Part BOM" relationship become visible. Is there any way to invoke the CUI changes on the Form Events ? Or should I be using a Method to hide/unhide the relationship tab rather than the CUI for the current use case. Thanks.5.7KViews0likes6CommentsVB,how to Update the parent property in the onafterupdate event
I have an item type and a relationship I want to calculate the sum of one of the columns of the relationship when the user presses the save button and update it to the parent item. If I put the method in the onafterupdate of the parent item, it will do an infinite loop If I put the method in the onafterupdate of the relationship, when I update the value of more than one relationship, it will prompt me that 「Aras.Server.Core.ItemIsNotLockedException」... 'this is my parent onafterupdate method code Dim inn As Innovator = Me.getInnovator() Dim score_1 as Integer = Me.getProperty("score_1") ' parentItem.自評分數 Me.fetchRelationships("Performance_SelfScore") Dim rs as Item = Me.getRelationships("Performance_SelfScore") 'get relationship Dim rsCnt as Integer = rs.getItemCount() If rsCnt < 1 Then Else Dim i,self_score,sum_self_score as Integer sum_self_score=0 For i=0 to rs.getItemCount() -1 self_score = rs.getItemByIndex(i).getProperty("self_score") sum_self_score = sum_self_score + self_score Next Dim score1 as String = Me.getProperty("score_1") Dim successor_job_cname as String = Me.getProperty("successor_job_cname") Me.setProperty("score_1",sum_self_score) ' '↓↓The following code is what I use to update the parent property 'The first way 'Dim Self_Eval As Item = Me.newItem("Performance_Self_Evaluation","edit") ' Self_Eval.setAttribute("where","id ='" + Me.getID() + "'") ' Self_Eval.setProperty("score_1",sum_self_score) ' Self_Eval.setProperty("successor_job_cname","approve_mg")'day_auth.getProperty("approve_mg")) ' Self_Eval = Self_Eval.apply() 'If Self_Eval.isError() Then ' Return inn.newError ("Performance_VB_test:Error Update Performance_Self_Evaluation " & Self_Eval.getErrorDetail()) 'End If ' 'Second method 'Dim Self_Eval As Item = inn.getItemById("Performance_Self_Evaluation", Me.getID()) ' Self_Eval.setAction("edit") ' Self_Eval=Self_Eval.apply() ' Self_Eval.setProperty("score_1",sum_self_score) ' 'The third way 'Me.setAction("edit") 'Me.setProperty("score_1",sum_self_score) 'Dim resultItem As Item = Me.apply() 'Me.setAction("") '↑↑ score1 = Me.getProperty("score_1") successor_job_cname = Me.getProperty("successor_job_cname") End If Can anyone give me any idea?4.7KViews0likes5Comments