If you've published the form template to the "serverinventory" Forms Library
and have pre-created the folder "server1" under "serverinventory", then yes,
it is possible to retrieve the value of the "serverName" field through code
and use it in the OnSubmitRequest event handler to change the FolderURL and
FileName properties of the DataAdapter that submits the form, and submit the
form (see
http://msdn.microsoft.com/library/en-us/ipsdk/html/xdobjDAVAdapterObject_HV01106
498.asp?frame=true).
Note: If the user enters a name in the "serverName" field and it does not
exist as a subfolder in the Forms Library, then an error will occur. So this
solution will only work for "static" values of "serverName".
If you want to dynamically create the Forms Library and/or subfolder when
submitting the form, then no, it's not possible.
---
S.Y.M. Wong-A-Ton
> Searching the newsgroups and MSDN didn't help so here goes:
>
[quoted text clipped - 10 lines]
>
> is this possible?
mike.wright@gmail.com - 05 May 2006 21:18 GMT
Actually, I figured out to dynamically create the subfolder when
submitting the form :)
Below is the code in the OnSubmitRequest() that does it:
var fso = new ActiveXObject("Scripting.FileSystemObject");
var WShell = new ActiveXObject("Wscript.Shell");
// Bind objServerName to the value of the serverName field.
var objServerName = XDocument.DOM.selectSingleNode("//my:serverName");
var strServerName = objServerName.text;
//Create a new folder in the Server Inventory Document Library.
var strNewFolderPath = "\\\\intranet\\personal\\mwright\\Server
Inventory\\"
var strNewFolderFullPath = strNewFolderPath + strServerName;
var strNewFolderName = fso.CreateFolder(strNewFolderFullPath);
Then I use the "var oXmlHttp = new ActiveXObject("MSXML2.XMLHTTP");"
just MSDN shows you how to use an HTTP PUT to place the change control
form in the server name :)
S.Y.M. Wong-A-Ton - 07 May 2006 21:43 GMT
Great! Thanks for sharing!
---
S.Y.M. Wong-A-Ton
> Actually, I figured out to dynamically create the subfolder when
> submitting the form :)
[quoted text clipped - 17 lines]
> just MSDN shows you how to use an HTTP PUT to place the change control
> form in the server name :)