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.3KViews0likes5CommentsError during database setup and admin login
Hello, I've followed the YouTube installation videos and installation guide PDFs to the letter several times, but it seems I can not get past an error. When I click "configure database" during Aras Innovator installation, after about a minute or two of what seems to be useful work, I get an error message that says: "Error 27506. Error executing SQL script CoreAndSolutions.sql. Line 136543. Must declare the scalar variable "@EXISTING_ID". (137)" I then hit OK and the "database installation process" stops without any further errors. At this point I don't know whether the installer attempted to continue to do other stuff or just gave up after the above error. I then click "Next" in the installer and continue Aras installation. There are no further errors and the installation is completed. I then go to: localhost/.../ and the login screen pops up. I enter "admin" as username and "innovator" as password, but I get the following message and can not proceed further: "Invalid column name 'id'." I started SQL management studio to check the DB, and the "InnovatorSolutions" db appears to be in there. Owner is "sa", size is 62.75MBi Number of users 6, Collation: Turkish_CI_AS This is a Windows 7, 64-bit system. SQL server is SQL Express 2014. Aras innovator is the latest innovator as of June 2018. We tried the entire installation process 3 times to no avail. We'd appreciate any help with this issue.2.6KViews0likes0CommentsWho is using the Aras SQL 'Federation ItemType Sample v3-1' and can share experience?
Hi community, Does anyone of you use the 'Federation ItemType Sample v3-1'? It´s a sample project that can be used to access external SQL database data via federation more easily. It basically contains a configuring ItemType that helps to setup the SQL connection faster, so you don´t have to code anything. As far as I know it´s only available for subscribers, but I think also free-users that don´t use this project can benefit from this discussion. The basic concepts of federation are always the same. I really like the project, cause it´s well designed and works fast and reliable. The project is a excellent foundation for federation. But form my POV there are still a lot of useful features missing (or simply weren´t implemented yet). I am looking for people who also use the project and have some experience with it. Maybe you even have enhanced the feature and want to exchange your ideas? I have done a couple of customization and would be happy to exchange them with other users! Enhancement that I have done myself: Keyed_name support for federated items (by default they just can show the id). Very useful, also my implementation is a bit of a dirty hack. So I am looking for way to solve this one a more professional way. Changed existing search mode to support wildcard search in item keyed_name (it´s an extension to the keyed_name support above) Support for integer search modes like >, <, <=, >= . By default you just can search for 'eq' and 'like' values. Support for maxResults, pageSize in the grid . This way users get better feedback when you have restricted the number of returned results Bug fix that prevents MPP to crash when you use a federated relationship in ItemType 'Part'. Bug fix to prevent item Preview crash when you use a federated relationship Enhancement or knowledge that I am looking for: Support for 'sort accross pages' Date Range search mode Enhancement regarding security, e.g. add some kind of permission system. The current Aras project seems to contain a lot of fields and functions that are just placeholders for future features. Or maybe I just don´t know how to use them? Ideas for enhancements or alternative concepts to do this kind of federation Of course also general feedback is helpful: Do you use the feature? If yes, how? Just for simply display of external data, or do you mix-n-merge? What is your experience regarding federation? Maybe you also know some bugs that occur in certain scenarios that I haven´t noticed so far? If you don´t use the project cause you´re not a subscriber you are also invited to join the discussion! If you are familiar with federation, you maybe also know some way to improve the display and work with external data. I assume similar pitfalls as in the project occur when you write your federation code by yourself. So most of the questions and enhancements should also be relevant for users who use a different concept Would be happy to connect and hear your experience! Every input welcomed! Many thanks already! Angela2.5KViews0likes8CommentsHow 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.5KViews0likes0Comments