How 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;13KViews0likes4Commentsusing the SQL item type as a view
Querying a SQL view I built in SSMS from an Aras server method: string SQL_View = "innovator.my_custom_sql_view"; string SQL = "select * from " + SQL_View; Item SQL_qry = inn.applySQL(SQL); This is quick for me because I do a lot in SQL, but I know it is bad practice. So, I want to replace this SQL injection using IOM: I created a new SQL item, type=View, with the contents from the custom SSMS view. What is the correct C# code to get the view results? Item SQL_qry = inn.newItem("SQL", "get"); SQL_qry.setProperty("keyed_name", SQL_View); SQL_qry = SQL_qry.apply(); This code just gets the SQL item, not the contents of the View. I couldn't find anything in the Programmers guide for this, and the Blog posts were only about Stored Procedures, not Views. I'm thinking it should work the same way, but I haven't figured out the correct IOM syntax. Thanks, Paul SheehySolved7.8KViews0likes4CommentsHow do I set a where statement on a Query Definition against the current date the query is run?
I want to only have it pull a specific relationship (Part AML) if a custom date field "Valid To" is greater than the current date. I am able to create the Where that compares it against a specific date, but this query definition is pulled by another process automatically and I don't want to have to update the Query Definition every day with the current date for whoever ends up running it that day. I currently have: [Valid to] > '2021-11-29T00:00:00' I want something like (this doesn't work) [Valid to] > current_date()3.3KViews0likes5CommentsHow to use SQL functions inside Innovator for large and complex queries?
Hi community, inside Innovator the "SQL" ItemTypes contains some Procedures, Functions and other things used for internal purposes: It´s also possible to add own custom items. Common for example is the use of procedures that can be called e.g. this way: Item callframe = this.newItem("SQL","SQL PROCESS"); callframe.setProperty("name","update_has_files_flag"); callframe.setProperty("PROCESS","CALL"); callframe.setProperty("ARG1", source_it.getProperty("name")); callframe.setProperty("ARG2", source_id); callframe = callframe.apply(); In my case I want to store a pretty huge SQL query as function within the SQL ItemType. Unfortunately I don´t know how to call these kind of functions from my Method. Does any one has an idea how we can use Functions? Many thanks for your help! Angela1.5KViews0likes0CommentsVery large ItemTypes/tables in Innovator with SQL Express - what is your experience?
Hi Community, can anyone of you share some experience when using ItemTypes that contain a large number of items? I have a Innovator ItemType that is intended to store up to 1-2 Million items for the start. For me this amount of data is already "a lot". But I assume for other users this is still a very small amount of data. Anyway, I assume that ItemTypes intended for huge amounts of data also requires admins to pay extra attention to ensure system performance. Do you have practical experience in working with large amount of data? Then I would be happy if you could give me some tips! 1. Did you ever face performance issues, especially when using SQL Server Express (which as some performance limitations by default)? 2. Can you recommend me some tips to optimize my ItemType for large data in general? E.g. I want to prevent that users try to display all items as once in the grid. Can I limit this one with max records or are there better options? 3. Anything else that is important to know? Many thanks for any input and best regards! Angela859Views0likes0CommentsUsing additional custom indexes in SQL for custom ItemTypes - any best practice tips?
Hi community, for a couple of tables I use additional SQL indexes for performance reasons. I noticed that the SQL ItemType allows us to specify custom indexes too and even contains a few for the most common used ItemTypes. Aras for example typically uses them for versioned ItemTypes like classic Part and CAD. The Aras SQL ItemType has one big advantage -> it´s a visible item that can be exported. Indexes used directly in the SQL database are less obvious to see for admins. I wonder if we should use something similar in our own custom ItemTypes in general. Especially for versioned ItemTypes. Of course SQL indexes are mainly used for performance reasons. There are multiple ways to optimize performance. But has anyone some tips when custom indexes should be considered by default (!) in the context of Innovator? @ Aras: Do you have any official recommendations or guidelines regarding SQL indexes? Many thanks for any hint! Best regards Angela0Views0likes0Comments