Am I missing something or do we have to implement our own callServer routine for creating the directory structure implied by the return value of the function registered with setAutoDCRPathGenerator()?
i.e., after enabling dcr-autonaming in the templating.cfg file, my formapi file contains the following code:
init(){
...
IWNameFactory.setAutoDCRPathGenerator(set_dcr_name);
}
function set_dcr_name(){
var item = IWDatacapture.getItem("/****/id");
var val = item.getValue().replace(/-/g, "/");
alert("VAL: " + val); // #=#
IWPageGeneration.setOutputFile(val + ".shtml", true);
return val;
}
I bring up a New Form Entry window, fill in the field (****/id) with the value "123-456-7890" and all other required fields, and then click on Save.
The alert comes up and looks fine - but then the save fails with the following error:[indent]
Save was unsuccessful. Invalid path //servername/default/main/yadda-yadda-yadda/WORKAREA/work/templatedata/category/data-type/data/123/456/7890 was received.[/indent]
The only reason I can think of this to be invalid is if it doesn't know how to create subdirectories - which seems like a significant oversite since apparently the IWPageGeneration.setOutputFile() function
does.
So - do I need to write my own callServer routine for this (not difficult code-wise, but a pain for other reasons) - or am I missing something?