Siebel Open UI PM - Remove unsaved attachment record
This is on Siebel IP 2016.
I have the following in an attachment list applet PM under "InvokeMethod":
if(methodName === "WriteRecord"){ // New file - validate file type var busComp = this.Get("GetBusComp"); var ext = getFileExt(busComp); var acceptedExts = ["pdf", "docx", "doc", "dot", "gif", "jpeg", "jpg", "jpe", "tiff", "tif", "png", "xlsx", "xls", "rtf", "txt"]; // "vsd" if(acceptedExts.indexOf(ext) === -1){ SiebelApp.Utils.Alert("Invalid file type (" + ext + ")") //busComp.UndoRecord(); returnStructure["CancelOperation"] = true; } else returnStructure["CancelOperation"] = false;}
This is currently working to stop any file types not mentioned above from being saved to the database.
What I'd like to have happen is the row in the list applet be removedhere as well. Problem is, busComp.UndoRecord() and busComp.DeleteRecord() aren't doing anything. Both return saying they were successful, but the row is still there and if I step off it again, it attempts to WriteRecord again and goes through this code again.