We are trying to save a DCR in a (site named) directory automatically i.e. data/incarecerated, data/fircrest, we are using a general DCR to pick up basic information for mulitply sites that all have index.shtml files. We have a variable called $site_type the holds the name of the directory. We have figured out how to save the .shtml file but not the dcr. We tried 2 solutions neither worked for us. We tried adding the value to the template cfg file:[html] When the user previews the file if we want to save the datacapture record in a specific directory under data, DO we put $site_type”? in preview-dir="/$site_type”? to save in for example directories called data/incarcerated or data/fircrest, they save under data now. [/html]And we tried adding code to the tpl: [html]function save_dcr(name){ IWDCRInfo.setDCRName(name, finalize);// not work var ofile = name.replace("/" + valuetype + /\.dcr/, ".shtml"); var ofile = name.replace(/\.dcr/, ".shtml");// ofile = ofile.replace(/^/, "/incarcerated/"); ofile = ofile.replace(/^/, "/" + valuetype + "/");// alert ("savedcr " + ofile + "; " + id_item + "; " + valuetype); ofile_item.setValue(ofile); IWPageGeneration.setOutputFile(ofile, true);}[/html]Thank-you for any help you can give me,Cindy
You can name your dcr in many ways. TS provides a default autonaming facility.
dynamic DCR naming can also be acheived based on any predefined variable value captured in the DCT extending the features of FarmAPI as rahulindia has suggested.