Validation

Hello, I have written method to validate the length of Item_id to 20. But there is error while attaching this method to Itemtype.Whwre should I attached this method on client event,server event,action or form events?? var inno = this.getInnovator(); var ItemId = this.getProperty("_item_id"); if (ItemId == null) { return inno.newError("Please provide a _item_id"); } if (ItemId.Length != 20) { return inno.newError("_item_id needs to be 20 characters."); }
Parents
  • Hi Angela, Server Events will only accept Methods that are written in C# or VB. There is a dropdown on the Method form that will allow you to change your Method from JavaScript to C#. You may also need to update the code to compile in C#. After saving your method as C#, you should be able to attach it to a Server Event without issue. Chris ________________________________ Christopher Gillis Aras Labs Software Engineer
Reply
  • Hi Angela, Server Events will only accept Methods that are written in C# or VB. There is a dropdown on the Method form that will allow you to change your Method from JavaScript to C#. You may also need to update the code to compile in C#. After saving your method as C#, you should be able to attach it to a Server Event without issue. Chris ________________________________ Christopher Gillis Aras Labs Software Engineer
Children
No Data