How to add restrictions to aras.vault.selectFile() file picker
Hi community, I currently design a custom form with a button that calls a regular file picker. In my scenario, end users shall only be able to upload certain datatypes, like txt and xml. As the affected users group does not have any edit rights for items, I have to upload the Files to the Vault and link them later to the correct items by a Server Method. As this approach directly throws files into the Vault, I want to ensure that only the right files can go through. What´s the best way to add restrictions to the file picker? var vlt = aras.vault; vlt.selectFile().then( function (fileObject) { if (fileObject.size > 1000 || fileObject.type != "text/xml" ) { return alert("This file can´t be right") } var fileItem = inn.newItem("File","add"); fileItem.setFileName(fileObject); fileItem = fileItem.apply(); var fileId = fileItem.getID(); // do something with the file } ); I have noticed, that the fileObject contains the mime type, file size and other file properties that I can use for a later filtering. It´s even possible to read the hex file signature, which maybe helps to prevent faked files. But I wonder if I can directly pass a filter to the file picker, so users can only select certain file types from the start. This way my lnnovator would not get in touch with invalid fileObjects at all. Thanks for sharing your ideas! AngelaSolved13KViews1like12Comments- 8.7KViews0likes7Comments
Callback not working properly if I dont have debugger in my javascript code
I have added a popup on button click on the mpp_OperationQuickEdit Form which opens form with a single relationship which I have created.It works like the 'Launch AML Editor' action on MCOs.I have added a save changes button which adds or remove relationships based on relationship added or removed.Then a callback function is provided.the relationships are added or removed successfully but the problem is that the callback works fine if I have put debugger in my javascript code otherwise it just closes both the forms the new popup and the quickEdit form.What could be the problem?6.4KViews1like12CommentsHow to close relationship search dialog box dynamically?
Hi Team, I have custom result binding code on 'OnSearch' event. On return of result if it is true it works fine but on false I want to close search dialog box that appear in relationship on click of pick related dynamically. I tried following method but it is not working. parent.dialog.close(); Any one can please help how to achieve this? Thanks & Regards Gaurav6.4KViews0likes3CommentsHow to reference the ItemType in the current tab in a Dialog box?
I'm working on a client side method to clone an ItemType using a dialog box. My approach is to make a form with a check box to choose to copy properties and another check box to copy values from a relationship tab, and a button for "Done" and "Cancel." Then opening that form inside a dialog box that's opened from a menu button. My problem is referencing the ItemType in the current tab from the dialog box. I tried adding the item as an argument to the dialog using the 'item' tag, but using document.thisItem returns 'undefined' for me.5.1KViews0likes1CommentProperty validation - Dialog to Confirm Ok or Not
Hello All, I've been struggling with a property validation use-case and I'm sure it's something that'd be useful to lots of folks. Have a working server event that blocks the user from proceeding if a certain property is left blank; however there may be cases when the user wants to proceed anyways with that field blank. As far as I've read, there's no confirmation dialog available via the Server Events, only error ones. So... looked at a Client-side event on the property validation. Good news is I'm able to get this event to fire. The bad news is the field is an "Item" and when an item is selected, it doesn't seem to actually save the reference. I'm doing this on a "Validate" event on the property itself. Has anyone done anything like this or have a suggestion? I don't really care if it's done against the property or a form, just need a way to highlight that something is blank and shouldn't be most of the time! Thanks in advance.2.5KViews0likes10Comments