Forum Discussion

didonato's avatar
didonato
Creator II
8 years ago

newResult

I'm having trouble with "newResult" in my method. I want to display either the method ran correcly or there was an error. I have something like this that i copied from the Aras Programmers Guide: Innovator innovator = this.getInnovator(); return innovator.newResult("This method was <b>successful</b>."); OR Innovator innovator = this.getInnovator(); return innovator.newError("This method has <b>failed</b>."); The newError works fine, but the newResult doesn't display anything.   Thanks    

3 Replies

  • Hi For some reason, the string you added to new result will only be parsed if you run the "ApplyItem" action and not "ApplyAML". When you run your code directly in the method editor and click the "Run Server Method" it works. Can you precise in which context you are doing this?
  • Hi Yoann, I basically want a  message box that says the action ran successfully. I'm testing this in a WorkFlow "Server Event"  that executes on "On Close" Innovator inn=this.getInnovator();   //*** Min Fielded PR *********************************************************** // Item hd= inn.newItem("MIN_Fielded_PR","get"); Item ControlledItem = this.apply("GetControlledItem"); hd.setID(ControlledItem.getID()); hd.setAttribute("select","id"); hd = hd.apply();   Item hdRelContact = inn.newItem("MIN_Fielded_PR_Contacts","get"); hdRelContact.setAttribute("select","related_id"); hdRelContact.setProperty("source_id",hd.getProperty("id")); hdRelContact = hdRelContact.apply();   if (hdRelContact.getItemCount() != 1) { return inn.newError("The 'Contact Information' is required. You must provide a value for this field before saving"); } else   { //”My code goes here”// return this.getInnovator().newResult("Your code ran successfully"); }  
  • didonato, The server side methods show only "error" messages. If there is no error dialog after server side method executed the assumption is that the method executed successfully.