You would need to use a callServer and a server-side script to create the directories for you. More than likely, you would need to think through the ramifications of the asynchronous nature of callServer during your Save process. Essentially, you'll probably want your save handler to return false, then the callback from your callServer could "re-start" the Save process by calling IWDatacapture.save once the directories are created.
// HANDLERIWEventRegistry.addFormHandler( "onSaveValid", generateDCR );// GENERATE DCR NAME & CALLSERVERfunction generateDCR() { // set the dir savepath = IWDatacapture.getItem('/ARTICLE/PATH').getValue(); // set autonaming DCR DCRname = IWDatacapture.getItem('/ARTICLE/TITLE').getValue(); DCRname = DCRname.replace(/ /g,''); var server = window.location.hostname; var parameters = new Object(); parameters.path = "/default/main/Branchname/WORKAREA/Common/templatedata/HereHere/Datatype/data/" + savepath; IWDatacapture.callServer("http://"+server+"/iw-bin/createDirs.ipl",parameters, true);}// WILL BE CALLED BY IPL CALLBACKfunction saveDCR( ){ IWDCRInfo.setDCRName( savepath + DCRname ); checkStatus();}// SAVING TAKES PLACE HEREfunction checkStatus() { var status = IWDCRInfo.getStatus(); if (status == IWDCRInfo.PENDING) { setTimeout("checkStatus()",2000); // call in 2 secs } else if (status == IWDCRInfo.AVAILABLE || status == IWDCRInfo.UNAVAILABLE ) { IWDatacapture.save(); // save new DCR or override it anyway } else { // Error!! Do something here }}
Ok, in case anyone wondering this is how I did it. Hopefully this will save a lot of people from being frustrated.