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:

Parents
  • 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");.  

    Chris


    Christopher Gillis

    Aras Labs Software Engineer

Reply
  • 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");.  

    Chris


    Christopher Gillis

    Aras Labs Software Engineer

Children