Method SaveAs Failing for JS

Weird behaviour. Almost every JS function will not duplicate using: Method row > Right-click > Save As.

One, very super simple JS method will, but I can't find another one that will do this. I'm getting:

  • Hi Neil,

    To avoid any conflicts when an item is copied, the value of any unique property is set to "Copy of {the original value}" on the copied item. I think is causing an issue where the resulting name of that copied Method is exceeding the maximum length of the name property on the Method ItemType. This would explain why it happens when you copy some Methods (with shorter names) and not others. Could you confirm this by checking the length of the names and the maximum length of the name on the Method ItemType in your database?

    Additionally, it might be possible to avoid copying this Method item entirely. There's a couple approaches that can help to avoid using duplicate code with the most simple one being to call your original JavaScript method from another method. You can do this by using aras.evalMethod("YOUR_ORIGINAL_METHOD_NAME");.  


    Christopher Gillis

    Aras Labs Software Engineer

  • aras.evalMethod is awesome to know about!

    I'm unable to inspect the db directly, however, if the ItemType property is directly correlated:

    You're correct, . I took the values of a 32 length name, proved the error. Then, with a method named with a string the length just less 'Copy of ', so 28 characters, I could use the Save As. The two different named functions had  the same simple content.

  • The error could be a little more apparent... Now that I recognize it I'll get it, but if that's a common error for a failed limit on a [var]char(32) it should indicate it won't fit?

    Thanks for figuring that out.