How to solve the error: The remote name could not be resolved: 'HostUrl'
Hi All, I am new to ARAS and i try to get familiarized with its concepts. In the current situation i try to connect two ARAS entities so they can send requests between each other (add, update, delete...) I created a server event method on ARAS N°2 to send request to ARAS N°1 using the code below: Innovator inn = this.getInnovator(); string myUrlAdress= "">hostOfAras1/.../anItemType"; var request = (HttpWebRequest)WebRequest.Create(myUrlAdress); request.Method = "POST"; AuthenticateHeader(request); string postData= "{\"_propretyOne\":\"ValueOne\",\"_propertyTwo\": \"valueTwo\"}"; var streamWriter = new StreamWriter(request.GetRequestStream()); streamWriter.Write(postData); streamWriter.Flush(); streamWriter.Close(); return this; } private void AuthenticateHeader(WebRequest req) { req.Headers.Add("AUTHUSER", "admin"); req.Headers.Add("AUTHPASSWORD", "607920b64fe136f9ab2389e371852af2"); req.Headers.Add("DATABASE", "DataBaseOfAras1"); req.ContentType = "application/json"; When i run it i get the following error: The remote name could not be resolved: 'hostOfAras1' of type System.Net.WebException NOTE: After some debug i noticed that the error is generated by this line of code " var streamWriter = new StreamWriter(request.GetRequestStream()); "9.4KViews0likes3CommentsNot a single item
I wrote down the following to get data from a relationship and insert it in an item type but unfortunately im having the following error I dont see an issue with my logic if someone can take a look i would really appreciate it. Not a single item Item ecrtask = this.newItem("ECR Task", "get"); ecrtask.setProperty("source_id", this.getID()); ecrtask = ecrtask.apply(); for(int i=0; i < ecrtask.getItemCount(); i++) { Item relDoc = ecrtask.getItemByIndex(i).getRelatedItem(); string title = ecrtask.getProperty("vsy_title",""); relDoc.setProperty("vsy_title",title); string relDocid = relDoc.getProperty("id",""); string sql = "update [innovator].[VSY_Task] set vsy_title = '" + title + "' where id = '" + relDocid + "'"; Item result = inn.applySQL(sql); }5.3KViews0likes6CommentsHow can I use this library within aras 11 SP12?
How can I use this library within aras 11 SP12? Hello, I am trying to send an email with a copy, to generate evidence, but I have only found that I should use this method of C # System.Net.Mail.MailMessage myEmail = new System.Net.Mail.MailMessage (); myEmail.Subject = "Test Innovator Email"; myEmail.Body = "Test Email."; myEmail.From = new System.Net.Mail.MailAddress ("test@test.com"); myEmail.To.Add ("test@test.com"); CCO.Email.SetupSmtpMailServerAndSend (myEmail); and the problem that I do not know how to use this method in aras innovator, can you help me know how to use this method of denteo de aras?Solved4.8KViews0likes3CommentsHow to use a tree grid view to create an ASP.NET menu tool
Hi, I would like to create a web form application ASP.NET to comunicate with Aras throught the IOM api. In Aras I created a query that I use for the tree grid view. The tree grid view contains the menu structure (with the main menu items and all levels bellow). Can I get the tree grid view result with an AML query or IOM code? Then I would like to use the XML result as datasource for the ASP.NET menu tool.4.5KViews0likes2Commentsc# method with several functions
Hi there, I am trying to make a recursive method in c# to process some relationships in my product structure which is based on several itemTypes. To do this I made different functions which are first called from a main. The only way I found to get the compiler to stop complain about CS0161 is to start the method like this: return this; } public Item main() { Innovator inn = this.getInnovator(); etc. and to remove the last } at the end of the method (I put the main first, then the functions, so I removed the } of the last function) But now I can see (with the help of visual studio) that my method is not running at all, it ends at the first } (the second line of the method). Is someone experienced with c# functions into Aras methods?4.1KViews0likes2CommentsWhat is the correct way to parse DateTime on a server side onAfterGet event?
Hi everyone. I'm currently trying to evaluate the current date and a date property however, when I try do parse the string provided by getProperty, it gives me the error: String was not recognized as a valid DateTime. I can confirm the property is of the Type: Date and Pattern: Short Date. My relevant code: [embed:dc8ab71f-3b98-42d9-b0f6-e21e02a0f8e2:5ea4aa05-9cf8-4f39-aaab-d8f235e33c77:type=text&text=for%20%28int%20i%20%3D%200%3B%20i%20%3C%20this.getItemCount%28%29%3B%20i%2B%2B%29%0D%0A%7B%0D%0A%20%20%20%20Item%20thisItem%20%3D%20this.getItemByIndex%28i%29%3B%0D%0A%20%20%20%20%0D%0A%20%20%20%20string%20dateStr1%20%3D%20thisItem.getProperty%28%22_calibrated_next%22%2C%22%22%29%3B%0D%0A%20%20%20%20DateTime%20date1%20%3D%20DateTime.Parse%28dateStr1%29%3B%0D%0A%7D] The only thing that I can think of that may cause this error is the date format conversion when localized from neutral UTC, but I couldn't find much in the Aras documentation related to this. ThanksSolved4KViews0likes4CommentsUpdate Parent Item when Relationships Tab is Changed
Good day all, I have ItemType sm_ITA with a Relationship of sm_ITA_Assignment. sm_ITA_Assignment (Assignments) is not related to another ItemType. When an Assignment is added or deleted I need the sm_license_count property of the parent sm_ITA to be updated with the count of Assignments. I have read several posts that seemed to be similar to this, but can't get anything to work. I have methods that will change sm_license_count on a save if it doesn't match the Assignment count, but it will not allow me to add or delete Assignments. I have a method that will make the update, but the sm_ITA has to be saved twice. Thanks for any help that can be provided of what I am missing. Will Update Value - sm_ITA Server Event onBeforeUpdate - Doesn't allow changes, additions, or deletions to Assignments Won't Update - sm_ITA Server Event onAfterUpdate this.fetchRelationships("sm_ITA_Assignment"); Item RelationshipsItem = this.getRelationships("sm_ITA_Assignment"); string count = "" + RelationshipsItem.getItemCount(); this.setProperty("sm_license_count", count); return this; Item ITA ("edit") - onBeforeUpdate & onAfterUpdate - Returns an error of "An item with the same key has already been added." Item ITA ("get") - onBeforeUpdate & onAfterUpdate - Does nothing var ITA ("edit") - onBeforeUpdate & onAfterUpdate - Returns an error of "An item with the same key has already been added." var ITA ("get") - onBeforeUpdate & onAfterUpdate - Does nothing Innovator inn = this.getInnovator(); int currentValue = Int32.Parse(this.getProperty("sm_license_count")); Item relItm = inn.newItem("sm_ITA_Assignment", "get"); relItm.setProperty("source_id", this.getID()); relItm = relItm.apply(); int totalCount = relItm.getItemCount(); // Number of entries in sm_ITA_Assignements string count = totalCount.ToString(); if(currentValue != totalCount) { Item ITA = inn.newItem ("sm_ITA", "edit"); // have tried with get ITA.setID (this.getID()); ITA.setProperty ("sm_license_count", count); ITA = ITA.apply(); } return this;Solved3.9KViews0likes5CommentsCan I customize Tree Grid View input XML
Hello, Question about Tree Grid View/method functionality. I'm are creating some kind of tree (for example Part BOM) & data comparison tool. I'm utilizing Query builder and I have 2 different query results in my method at hand. And now we are planning how to visualize the comparison results to the user. One idea was to utilize Tree Grid View which would fit well in our plans in many levels, but is it customizable enough is the big question. Can I somehow feed or get TGV to read my results? Can I somehow use CSS or modify how TGV could show the results (for example I want to use colors to show the differences between structures & data)? Or is it so the TGV always need's direct results from Query Builder? And the XML it's eating cannot be changed - or are they way to modify it? Or are there any other ways to do it? I believe this is not unique problem. I'm using query builder similarly like in: https://community.aras.com/b/english/posts/using-query-definitions-method-code. And I'm utilizing Form Dialogues currently to ask from user what to compare. Cheers, Jukka Lehtinen3.8KViews0likes4CommentsReuse Code in C# Method
Good day all. I am trying to use a variant on my previously posted Workflow Process Get Change ItemType. I want to reuse some of the code multiple times without having to write it out every time. The code references identId, but I can't figure out how to change the variable based on information pulled from the Workflow. I have tried If statements to change the variable, but they return an error about not being able to convert a string to a string. I know if there is a way to change the identId then I don't have to continue to copy/paste the foreach section. Thank you for any help that can be provided. foreach (string i in identId) { Item assignment = this.newItem("Activity Assignment", ""); assignment.setAction("add"); assignment.setProperty("source_id", actId); assignment.setPropertyAttribute("locked_by_id","is_null","1"); assignment.setProperty("related_id",(i)); assignment.setProperty("voting_weight", (100 / identId.Count() + 1).ToString()); // Divides the number of IDs in identId and adds 1 assignment.setProperty("is_required", "1"); assignment = assignment.apply(); if (assignment.getItemCount() != 1) return inn.newError("Error creating assignment: "+assignment.getErrorDetail()); }2.8KViews0likes2CommentsE-mail to Group Identity
Good day all. I am having a problem figuring out how to create a list of e-mail addresses based on the members of an Identity. I am trying to set up a C# Method to review an ItemType and send an e-mail when there are items that meet the criteria. I have everything working based on getting the the User ID of the currently logged in User. I can't figure out how to create a list of the the Member related ids to create a list of the User e-mail addresses. Thank you for any help that can be provided.Solved2.1KViews1like3Comments