Aras REST Api
Hi, I am trying to build a C# HttpClient that will interact with Aras REST Api, I have followed the setup from this document Aras Rest API I noticed that I have to log into a pop up window very X minutes. Does anyone know if there is a way to pass user credentials into the token call? Thanks,229Views0likes4CommentsHow to check my schedular is running?
Hi, I have a method that need to run via schedular on every 1 minute. I need to check and hold the schedular until previous trigger (schedular execution) got completed. if the previous schedular execution is in process then we got error for next trigger, i.e. SQL transection error. Please suggest how to overcome this situation. I do not want to increase the schedular frequency. Thanks in Advance Deepak101Views0likes2Comments'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.160Views1like0CommentsAny way to instantiate a C# class that is within another method or file?
I have written a C# class helpful for me in refactoring some processing of an older method. This C# class could prove helpful for other modules which perform the same logic. Is there anyway to have this class defined in a C# server method that I can instantiate whenever I want? I know one can call a server method from a server method, but that will return AML and can do processing within it, but that would not be ideal as it would require extra work to lay out how to trigger to perform x or get y, etc. when I may only really need to do something small and then would need to make sure to return the correct AML and would become a mess if something else wants to do the same thing with a different return value in the AML, it would be unpragmatic. So any way to instantiate a C# class? Do I need to go into the code tree or something? Preferably I would like the class to share the lifetime of the server method which instantiates it. Best Regards, FrankSolved70Views0likes1CommentNeed 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;80Views0likes1CommentWhat 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!252Views0likes1CommentNeed Guidance: Prevent On Close Server Event to get called when there is Error (when voting) and the CM Activity is not Closed?
Hello All, I'm creating a server-side method that sends an email to the Change Leader. It gets invoked "on close" in association with a Change Management workflow activity. The email should be sent only when the activity is closed, and the workflow progresses to the next activity. However, if the user votes on the activity while there are missing affected files related to the Change Management, an error message is displayed stating "The New Number field is required when Action is set to 'Add'." I want to find a way to prevent the email from being sent when such and similar errors exist. I tried to use activity.getProperty("state", ""); to check if the state of the activity changes from Active to Closed. However, this property does not update (when the method is invoked) while the mentioned error exists or not. Currently, I'm thinking of a way to access this error message content from my method and act accordingly. I tried isError() and it gives 0 (no error), getErrorString() and getErrorDetails() return an empty string. I would appreciate it a lot if someone can help me with it. Best Regards, abduSolved63Views0likes1CommentE-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.2KViews1like3CommentsUpdate 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;Solved4KViews0likes5CommentsWhat 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: for (int i = 0; i < this.getItemCount(); i++) { Item thisItem = this.getItemByIndex(i); string dateStr1 = thisItem.getProperty("_calibrated_next",""); DateTime date1 = DateTime.Parse(dateStr1); } 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. ThanksSolved4KViews0likes4Comments