Method event version type "Version 2" - where do we find more samples and guidelines?
Hi community, does anyone of know how to use the "Version 2" type for ItemType Server Methods? Let´s assume we use an onAfterAdd/Update event in the Part BOM ItemType. With Event Version 1 the event is fired for each single row. Which version 2 it would be executed on the complete item group. From my POV version 2 is useful to improve performance for certain tasks. But there is not much information out there that describe how to use this version type. The context item in version 2 is empty by default. So "this" simply contains nothing when we execute a Method with "Version 2". I assume that we have to extract the information of the affected items from the "eventData" parameter in the background. I found some minor code samples in the code used for Effectivity and Derived Relationships. But they are to specific for being used in other contexts. Does anyone know more about using "Version 2"? Thanks for any tip!!! Best regards Angela0Views2likes14CommentsCode Snippet: Generic, Reusable Code to Get All Identities In a Group
Hello everyone, Here is a code snippet to retrieve all identities in a identity (group) recursively. As I faced this requirement multiple times, and Innovator not having a standard function for it, I decided to create it myself. [embed:dc8ab71f-3b98-42d9-b0f6-e21e02a0f8e2:609a024f-f7a3-41b9-8f03-c991fd46edd3:type=csharp&text=%2F%2F%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%0A%2F%2F%20%5BAUTHOR%5D%3A%20SOFTWERK%3A%20D.%20Theoden%0A%2F%2F%20%5BCREATED%20ON%5D%3A%202024-01-18%0A%2F%2F%20%5BMETHOD%5D%3A%20aer_get_identities_in_group.cs%0A%2F%2F%20---------------------------------------------------------------------------------------%0A%2F%2F%20%5BDESCRIPTION%5D%3A%0A%2F%2F%20Generic%2C%20reusable%20code%20to%20get%20all%20users%20in%20a%20group.%20Implements%20trick%20to%20use%20functions%0A%2F%2F%20inside%20Aras%20Innovator%20server%20methods.%0A%2F%2F%20---------------------------------------------------------------------------------------%0A%2F%2F%20%5BCHANGES%5D%3A%0A%2F%2F%20REF%20NO%20%20%20%20%20%20%20DATE%20%20%20%20%20%20%20%20%20%20%20%20WHO%20%20%20%20%20%20%20%20%20%20%20%20%20DETAIL%0A%2F%2F%20%23001%20%20%20%20%20%20%20%20%202024-01-22%20%20%20%20%20%20D.%20Theoden%20%20%20%20%20%20Initial%20version.%0A%2F%2F%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%0A%0A%2F%2F%20Define%20parameters%0AItem%20item%20%3D%20this%3B%0AInnovator%20inn%20%3D%20item.getInnovator%28%29%3B%0AList%3Cstring%3E%20userIdentities%20%3D%20new%20List%3Cstring%3E%28%29%3B%0A%0AItem%20initialIdentity%20%3D%20inn.getItemById%28%22Identity%22%2C%20%22804E11705E1D4E98AEBBDB8E9AFC0B7C%22%29%3B%20%2F%2F%20Your%20existing%20logic%20to%20get%20a%20%28group%29%20identity%0AProcessIdentity%28initialIdentity%2C%20inn%2C%20userIdentities%29%3B%0A%0A%2F%2F%20Rest%20of%20your%20logic%20here.%20All%20recursively%20found%20identities%20are%20now%20stored%20in%20userIdentites%20array.%20%0Areturn%20this%3B%0A%0A%7D%20%2F%2F%20Allow%20functions%20in%20server%20methods%20Part%20A%3A%20extra%20curly%20brace.%20This%20is%20NOT%20a%20mistake.%0A%0A%2F%2F%20Function%20to%20recursively%20process%20identities%20and%20add%20unique%20users%20to%20the%20list%0Avoid%20ProcessIdentity%28Item%20identity%2C%20Innovator%20inn%2C%20List%3Cstring%3E%20userIdentities%29%20%7B%0A%20%20%20%20if%20%28identity.getProperty%28%22is_alias%22%2C%20%22%22%29%20%3D%3D%20%221%22%29%20%7B%0A%20%20%20%20%20%20%20%20%2F%2F%20Add%20user%20identity%20if%20it%27s%20unique%0A%20%20%20%20%20%20%20%20string%20userId%20%3D%20identity.getID%28%29%3B%0A%20%20%20%20%20%20%20%20if%20%28%21userIdentities.Contains%28userId%29%29%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20userIdentities.Add%28userId%29%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20%2F%2F%20Process%20group%20members%0A%20%20%20%20%20%20%20%20Item%20groupMembers%20%3D%20inn.applyAML%28%22%3CAML%3E%3CItem%20type%3D%27Member%27%20action%3D%27get%27%20select%3D%27related_id%27%3E%3Crelated_id%3E%3CItem%20type%3D%27Identity%27%20action%3D%27get%27%3E%3C%2FItem%3E%3C%2Frelated_id%3E%3Csource_id%3E%22%20%2B%20identity.getID%28%29%20%2B%20%22%3C%2Fsource_id%3E%3C%2FItem%3E%3C%2FAML%3E%22%29%3B%0A%20%20%20%20%20%20%20%20int%20memberCount%20%3D%20groupMembers.getItemCount%28%29%3B%0A%20%20%20%20%20%20%20%20for%20%28int%20j%20%3D%200%3B%20j%20%3C%20memberCount%3B%20j%2B%2B%29%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20Item%20member%20%3D%20groupMembers.getItemByIndex%28j%29%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20Item%20memberIdentity%20%3D%20member.getRelatedItem%28%29%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20ProcessIdentity%28memberIdentity%2C%20inn%2C%20userIdentities%29%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%7D%0A%0A%2F%2F%20Any%20more%20functions%20of%20your%20own...%0A%0Avoid%20enableFunctionsInMethods%28%29%20%7B%20%2F%2F%20Allow%20functions%20in%20server%20methods%20Part%20B%3A%20opening%20dummy%20method.%20This%20is%20NOT%20a%20mistake.] I hope this saves you some time too. All the best from Almelo. Daan0Views2likes0CommentsMethod Templates in Release 31+ : What do you we need to know about them?
Hi community, since a few releases Aras added a "Template" item selector to the Method ItemType. Release 2023 already contained the new property, but didn´t use it yet. It was also hardly used in I30. But there is much more going on since I31. What do we need to know about Method Templates?Solved0Views1like3CommentsHow 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.0Views1like1CommentCalling server side Methods directly from CUI element ?
Hi community, does anyone know anything about calling server side Methods from CUI elements? Right now we can only use client events for CUI elements. Sure this elements can call a server event and then return the result, but we ALWAYS need the extra Method and I am tired of it. I tried to use a standardized calling Method, but often one static Method doesn´t fit to all the CUI variants. CUI sometimes uses server events, but mainly to "build" complex non-standard elements automatically and not really for normal user interaction (Data Model). The predecessor of CUI elements were 'Actions'. These elements supported both types of Methods, client and server. So I have some hope that server support for CUI is not complete illusionary. I am not sure if we really can find a solution within this forum thread. Of course if you know a solution or workaround and I haven´t noticed it I would be happy to know! But maybe we can collect people who also want Server Method support for CUI. And if times go on as crazy as they are, Aras will even see one day that there is a demand for this feature! Thanks! Angela730Views1like0Comments'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.0Views1like0Comments