Possibly use iwat.exe to be used to trigger some custom code that gets the current file and renames it. One issue would be how would you handle the "Done" button on the bottom of your form that sends the current DCR to the next page since the DCR it's looking for is now using a different name. Or you could do the renaming in a workflow prior to the the submit to staging task (deleting the user named file). Again, you would need to alert your users of the behind the scenes naming change of their DCRs.Another option if you're running Windows Server 2003 or 2008, then you may be able to use Windows File Server Resource Manager to force certain naming conventions.http://technet.microsoft.com/en-us/library/cc754810(WS.10).aspxI must mention that I have not used this myself. It may or may not work on the Y: drive. If you try it out, let us know the results.__________________
In all reality, you shouldn't be the one manipulating their filenames. They should be creating their names using lower cases. If you can't rely on them to do this then you should set up some kind of rule that prevents this. Is there a reason that you want to perform the lowercase instead of having your users do it themselves?
I work for a Government Agency and elder respectable people do not like any alerts or anything which restricts them, all they need is the things to work from their perspective. So I have to do my manipulations, no other alternative.Thanks
I have the same old DCR saving issue. I want to convert the name given by user to the DCR to all lowercase letters and then save the DCR, here is the snippet what I have. I know that IWDCRInfo.setDCRName(outputFileName); is an asynchronous process and doesn't complete spontaneously. Is there any other way of doing it?Here is the snippet.[html]function setOutputFileName (outputFileName) { outputFileName = outputFileName.toLowerCase(); alert(outputFileName); IWDCRInfo.setDCRName(outputFileName); } function onSaveNameSpecifiedHandler(vPath) { alert("OnSave"); var regExp = new RegExp(IWDatacapture.getWorkarea() + "/templatedata/" + IWDatacapture.getFormType() + "/data/(.+)"); var outputFileName = vPath.replace(regExp, "$1"); alert(vPath); var mySplitResult = outputFileName.split("/"); setOutputFileName(mySplitResult[1]); return true;} // End of function onSaveNameSpecifiedHandler(vPath) {function init() { IWEventRegistry.addFormHandler("onSaveNameSpecified",onSaveNameSpecifiedHandler);} // End of function init() {IWEventRegistry.addFormHandler("onFormInit", init);[/html]Thank You
IWEventRegistry.addFormHandler("onFormInit", init);function init() { IWEventRegistry.addFormHandler("onSaveNameSpecified",onSaveNameSpecifiedHandler);}function onSaveNameSpecifiedHandler(vPath) { var outputFileName = vPath.replace(/.*\/data\/(.+)/, "$1"); setOutputFileName(outputFileName); return false; // That's right, return false!}function setOutputFileName (outputFileName) { IWDCRInfo.setDCRName(outputFileName.toLowerCase()); IWDatacapture.save();}
You need neither callServer nor iwat Event handling for this... TryIWEventRegistry.addFormHandler("onFormInit", init);function init() { IWEventRegistry.addFormHandler("onSaveNameSpecified",onSaveNameSpecifiedHandler);}function onSaveNameSpecifiedHandler(vPath) { var outputFileName = vPath.replace(/.*\/data\/(.+)/, "$1"); setOutputFileName(outputFileName); return false; // That's right, return false!}function setOutputFileName (outputFileName) { IWDCRInfo.setDCRName(outputFileName.toLowerCase()); IWDatacapture.save();}Once upon a time we've discussed a bit more elaborated processing of asynchronous "setDCRName" in [thread=20152]this thread[/thread].
Lets say I have given name as MYDCR.xml and I would like to save as MYDCR_TodayDate.xml (MyDCR_02282014.xml)