Get the Context Action Name in the Method
Hi All, I have Multiple Server Side Item Actions Configured on the Part Item , I want the logic/functionality to be performed by each action to be controlled by the same method . In which case , is there a way to pass the Invoking action name to the Method so that based on the value I can chose the function to be performed. For the above action , I want to get the action name "plm_Test" while invoking the method on the Item. This would greatly help me in avoiding creating Multiple Methods for each Action. Thanks.5.2KViews0likes7Comments'The given key '()' was not present in the dictionary.' Error
Wanted to provide a solution to an old post on here. In our situation, when this item presented, it was a missing item from one of the float codes, specifically for updates. This is a C#, server-side method. Under the 'new Dictionary' item list, we added the missing item by its item type name and the name in which we would like to describe it--there should be others listed as well to model from. Your switch(thisType) list should be consistent with the new Dictionary list below it as well. After saving this method, your item should be able to save and float that information. If it does not, inspect other dictionary code lines in your float methods.0Views1like0CommentsBrowse the versions of an item
Hi everyone , I'm currently trying to implement a C# method that should be able to browse all the versions of a Part Item , thus we can read the states of the different versions and promote them . but the problem is that I don't know how to get the versions of an Item . Does anyone know how to solve this issue please ? Thanks in Advance Hamdi5.3KViews0likes4CommentsNeed server method to hide property of an Item for specific identity
As the tilte says. We want the "Classification" property of ItemType "Document" to be hidden for a user if they are part of a specific identity. I also want the value of "Classification" to set as "General" for these users when they search of Documents. I have achieved this. However, now we do not want the users of this identity to be able to see the "Classification" column in the search grid. How do I accomplish this. I apply the code below to "onBeforeGet". Mentioned below is my method: Innovator inn = this.getInnovator(); //Get ID of the logged in user Item alias = inn.newItem("Alias","get"); alias.setProperty("source_id",inn.getUserID()); alias.setAttribute("select","related_id"); alias = alias.apply(); string relatedId = alias.getProperty("related_id"); int count = alias.getItemCount(); string target = "DBA5D86402BF43D5976854B8B48FCDD1"; if(relatedId == target){ this.setProperty("classification", "General"); this.createRelationship("Property", "edit"); this.setProperty("id", "DE3C90BC7B434151A6F3C9D97A5B2B69"); // Property ID this.setProperty("is_hidden", "1"); // Hide the property this.setProperty("is_hidden2", "1"); // Hide the secondary property } return this;0Views0likes1CommentWhat is the correct syntax of writing "where" statement in AML with C#
I need to write just write one line of AML wrapped in C# and store the ID of the item in a variable code: Innovator inn = this.getInnovator(); string amlString= @"<AML><Item type='Document' action='get' where='item_number='MADL002828'' select='Document.id'/></AML>"; Item results = inn.applyAML(amlString); return results; Everything works except for the "where" clause in it. Just can' figure out the what kind of quotation marks does this require. Thanks!0Views0likes1CommentIs there an easy way to run code after a change/creation transaction finished?
Hello, I need to send a created/ changed item to another service. I have some code that just needs the ID of an Item, it then retrieves it from the database and sends it to the other service. The problem I am facing is that, I can't find a way to run said code after the item is saved to the database. If I try to run my code in the onAfterUpdate Event it fails because it tries to retrive the item with the new ID before the transaction finsihed. So basically what I am looking for is something like an onAfterTransaction Event. Would appreciate any ideas on how to approach this problem. Thanks!0Views0likes3CommentsServer Method working when given a GUID, but not when using this
Hello, When I run this server method from the method itself and use a GUID to get the Item I want to update the method works fine, but when I change it from a GUID to = this; and run it from the Item Type on the server events "OnBeforeUpdate" it crashes the whole server and the server has to be restarted. // Item KSAAsses = inn.getItemById("smc_KSA_Assessment","2956D6CFB25949D39985FF112F2395FA"); Item KSAAsses = this; Has anyone ever ran into something similar? I can post more code if needed. Thank you for your help!Solved0Views0likes3CommentsGet item using multiple Where conditions and edit the item
I am trying to edit the State of a Part with a specific generation, "1". The output of the following is just "<Result/>" [embed:dc8ab71f-3b98-42d9-b0f6-e21e02a0f8e2:9a6a26a7-70fb-4a82-93de-26eefb432e27:type=text&text=Innovator%20innovator%20%3D%20this.getInnovator%28%29%3B%0Astring%20configId%20%3D%20this.getProperty%28%22config_id%22%29%3B%0AItem%20itm%20%3D%20this.newItem%28%22Part%22%2C%20%22edit%22%29%3B%0Aitm.setAttribute%28%22where%22%2C%22part.item_number%3D%2711-1-1D123%27%20AND%20part.generation%3D%271%27%22%29%3B%0Aitm.setProperty%28%22state%22%2C%22Released%22%29%3B%0Areturn%20itm.apply%28%29%3B] However, if I use "setProperty" with "get" in separate lines I get the correct output. However, I can't use "setProperty" to filter with "edit" because it sets a new value for the property. Below is the code: [embed:dc8ab71f-3b98-42d9-b0f6-e21e02a0f8e2:161b262a-2907-49f7-8c2f-47f2f3418f14:type=text&text=Innovator%20innovator%20%3D%20this.getInnovator%28%29%3B%0Astring%20configId%20%3D%20this.getProperty%28%22config_id%22%29%3B%0AItem%20itm%20%3D%20this.newItem%28%22Part%22%2C%20%22get%22%29%3B%0Aitm.setAttribute%28%22select%22%2C%20%22id%2Cgeneration%2Cmajor_rev%2Cstate%2Citem_number%22%29%3B%0Aitm.setProperty%28%22generation%22%2C%20%221%22%29%3B%0Aitm.setProperty%28%22item_number%22%2C%20%2211-1-1D123%22%29%3B%0Areturn%20itm.apply%28%29%3B]0Views0likes3CommentsHow to stop\pause life cycle promotion to edit a part?
I need to edit some Part properties such as State, Release Date, Revs, etc. But everytime a Part is edited a new version is created where the Rev increments. I do not want this to happen. I want to edit the part and have it not create a new version.Solved0Views0likes2CommentsHow to use Visual Studio Code 2022 for Coding Methods
I am new to Aras development, and I'd like to use Visual Studio Code 2022 ("VS Code") for coding Innovator methods. I found the ArasVSMethodPlugin project on GitHub, and its change log indicates that support for VS Code 2022 was added in version 1.21. However, when I attempt to load the plugin using the .vsix file from the Aras Innovator Method Plugin on Open VSIX (which was updated 3 months ago), I get a message telling me that Code can't find a package.json file that its expecting. Details about the package.json file for a VS Code extension can be found on this Publishing Extensions page. I was wondering if anyone else was using VS Code 2022 for coding methods and if they might have any additional information about how to get it working. Thanks in advance for any/all assistance.0Views1like1Comment