permissions error when trying to create a relationship
Dear Community, I am new to Aras and am trying to create a relationship from a RelationshipType with the following code: Innovator inn = this.getInnovator(); string ItemId = this.getID(); Item item = inn.getItemByKeyedName("GivenItem", "100013-001"); string itemfather = item.getID(); if(item == null) { return inn.newError("No given item found."); } else { Item relItem = inn.newItem("GivenRelationship","add"); relItem.setProperty("source_id",ItemId); relItem.setProperty("related_id",itemfather); return relItem.apply(); } return this; The method runs onAfterAdd on a relationship ItemType server event. I do not know how to solve this error which comes with the apply() method: "You have insufficient permissions to perform 'add' operation." I am also looking for a way to retrieve the GivenItem item because we dont know its keyed name. What I want to do is to retrieve the Item of type OtherType which has a relation whith the item of type GivenItem (there will be only one each type). Is there a method which permits to get the only item of a given type? Best regards, Camille14KViews0likes19CommentsHow to call a server method with applyMethod() from a client method, and use the results coming back from server
Server Method : [Get_Identity_Details] Can run this and get results I want. Hard coded guid for test Innovator inn = this.getInnovator(); string sessionuserid = this.getProperty("sessionuser","invalid"); if (sessionuserid == ""){} StringBuilder sql = new StringBuilder(); sql.AppendLine("SELECT ID,KEYED_NAME FROM [ArasDev].[innovator].[IDENTITY] WHERE CLASSIFICATION='Group' AND ID in "); sql.AppendLine(" ( SELECT SOURCE_ID from [ArasDev].[innovator].[MEMBER] where RELATED_ID in"); sql.AppendLine("( SELECT ID FROM [ArasDev].[innovator].[IDENTITY] WHERE CLASSIFICATION='Role' AND ID in"); sql.AppendLine("( SELECT SOURCE_ID from [ArasDev].[innovator].[MEMBER] where RELATED_ID in"); sql.AppendLine("(SELECT RELATED_ID from [ArasDev].[innovator].[ALIAS] where SOURCE_ID='<USER GUID>'"); sql.AppendLine("))))"); Item results = inn.applySQL(sql.ToString()); return results; ======================================= Client method : calls the server method. Can see the result in debug from server method, but it does not work after that. How to make use of the results from server method? var inn = new Innovator(); var userid = inn.getUserID(); var itemTypeDropdownComponent = getFieldComponentByName("owned_by_id"); var itemTypeDropdownList = []; var body = "<sessionuser>" + userid + "</sessionuser>"; var res = aras.applyMethod("NOV_Identity_Details",body); if (res.isError()) { aras.AlertError(res); return; } else if (res.getItemCount() === 0) { //do something } else { for (var i=0;i<res.getItemCount();i++) { var currentItem = res.getItemByIndex(i); itemTypeDropdownList.push({label: currentItem.getProperty("KEYED_NAME"), value: currentItem.getProperty("ID")}) } } itemTypeDropdownComponent.component.setState({ list: itemTypeDropdownList }); return null;13KViews0likes4CommentsHow to pass Form fields value to Method
I'm new in Aras Innovator and I need some help with Forms. I have created a simple form with first name and last name and with a Submit button. The button's click event will call a method where I want to use the first and the last name field values. How can I pass the value from form to method and how can I use it there? And also where can I complete the form to try it?13KViews0likes6CommentsMouse Over Help Problem
Good day all. I was looking at the Mouse Over Help project. I copied the script into a method, but when I run it there is an event handler error "Unable to set property 'title' of undefined or null reference. I'm not sure how to correct this. Any help would be appreciated. Thank you.13KViews0likes13CommentsHow to color grid cells according to properties that are hidden in grid?
Hi Community, I hope somebody can give me some hints to solve the following use case. I use an onAfterGet Server Method in ItemType Part that colors certain columns like ‘state’. Now I want to add some color to an additional property that contain the ERP-Number of a Part. The ERP-Number column shall be colored according to two other properties that give information about the state of the erp transfer. But I don´t want to display the two additional properties in the main grid. That´s why the two properties are hidden by default. This now leads to the following problem. When my two state properties are hidden, they are not part of the get query that is run when performing a simple search in the Part grid. When the properties are not selected in with the get query, I cannot use them for coloring with my onAfterGet method. Is it somehow possible to add the two properties to the grid select query, but without showing the properties in the grid? Or does anybody now other ways to add some color to grid cells? I am thinking about some federation approach, but maybe this one can be solved easier. Thanks for any help! Best regards, AngelaSolved11KViews0likes6CommentsSetting properties using results from dialog
I'm having problems updating an item property using a method that opens a custom dialog. I opened a dialog following the ArasModules.dialog example from https://community.aras.com/b/english/posts/tech-tip-opening-a-custom-dialog-from-a-method, the dialog opens to a form where the user can select an item from a list which is returned in the "res" value of the callback function. Once there, I wanted to set the property of an item to this value, but it seems like i lost the original context item and innovator object after opening the dialog. When I debug in the browser the "this" item is of the [object window] type. The results contain two id strings, and I'm trying to use them to set an "item" property. I tried defining a new innovator object and setting the property but I can't get it to actually apply the changes. function callback(res) { if (res) { var id_1 = res[0]; var id_2 = res[1]; var inn = new Innovator(); var item_2 = inn.newItem("MyItemType","edit"); item_2.setID(id_2); item_2.setAttribute("select","MyProperty"); item_2.setProperty("MyPropertyl",id_1); item_2.apply(); } } How can I set the property from this context? /Rick8.4KViews0likes5CommentsChange 'Save As' to use part number sequence instead of adding Copy Of in the part number field?
With Aras V11, SP15: For the Part Item type, we have a pattern setup that we want all parts to follow this pattern: PRT-##### and we want it restricted to this length (9). This works. However, when someone does a 'Save AS' or in an Express ECO chooses to renumber a part. we get this error "The given value of type String from the data source cannot be converted to type nvarchar of the specified target column." This is because we've set the item_number length to equal 9 and Aras is trying to create a new part with the number field set "Copy of PRT-#####". We can get past the error by setting the item_number length to 20 but we don't want to do this as people can then create parts that don't match our pattern. Where can we change it so Aras doesn't add the "Copy of" in front of the original part's number: We'd also ideally like it to just grab the next number in our part number sequence. I've been hunting through aras methods but can't find where the "Copy of" is being added. Anyone know? Thanks.Solved7.7KViews0likes4CommentsSet a customized user in workflow history
Hi, I want to set a specific user in workflow history report. Consider I've Part item which have 3 states A,B and C. Usually the signoff from B->C is done by X always but I want to set it to Z in workflow history report. Can I know how it is possible ? Thanks6.8KViews0likes3Comments