Restrict file types on Manufacturer Part

Hi, I would like to restrict the file types available to add to a Manufacturer Part to say .pdf and .png . I imagine a kind of filter on the file dialog that pops up when I create a new relationship on an item.  How would I go about that? I realize there is a File Type item type, I just don't know how to use it, or if I need it at all. All inputs appreciated   --Carsten
  • Not sure we can send parameters to the file search dialog. without changing a core script Would this be acceptable to check the filetype on the save action?
  • Hi Yoann, thanks for your quick reply! At this moment I think anything will be better than allowing all file types :) What have you got?
  • on the file itemtype, you need to add a server event triggered on the event "onBeforeAdd" the Csharp method will have a context = the AML request to add the file. something like this.getProperty("filename") should give you the filename to check the extension, check on the file Itemtype if there is a more specialized tag something like "extension". If the extension is correct for you return "this" (it passes it to the onAdd action handler inside Aras) if not then return an error (something like return this.getInnovator().newError("invalid filetype")
  • to specialize the behavior to manufacturer parts, you maybe need to put the method on the relationship, not sure how you called it. I guess something like "Manufacturer Part File", you look at the itemtype and you add your method on a "onBeforeAdd" event, but in this case the context "this" will be slightly different.