Upload, Activate, Deactivate, Remove Form Templates

I get the stsadm command for uploading  form templates goes like this:

C:Program FilesCommon FilesMicrosoft Sharedweb server extensions12BINstsadm.exe -o uploadformtemplate -filename C:MyFolderMyForm.xsn

But the -help activateformtemplate says this:

stsadm -o activateformtemplate
 -url <URL to the site collection>
 [-formid <form template ID>]
 [-filename <path to form template file>]

so we can go with formid or we can go with path and filename. 

Next, the formid is exposed when you view the form properties by hovering over the form on the Manage Form Templates and clicking on View Properties.

Of course, when we use stsadm.exe to upload the form, we have no way of knowing what the formid is.  Which brings us to -filename.  Can we activate using a path and filename to a site collection and have it still be the same form that's uploaded to the Manage Form form library?  I would guess not but I would also guess that there's doggone few people that know for sure so let's add to that count.

Yes, this is odd.  But, if you look at the form template properties in InfoPath designer, you'll see that it knows its form ID and, obviously shares that knowledge with the form template that's loaded into the form server.  That lets us use the -filename parameter just the same.

So your "No GUI" form management routine goes like this:

Verify:  

stsadm.exe -o VerifyFormTemplate -filename c:MyFormFolderMyForm.xsn  

Upload:

stsadm.exe -o UploadFormTemplate -filename c:MyFormFolderMyForm.xsn  

Activate: 

stsadm.exe -o ActivateFormTemplate -url http://MySiteCollection -filename c:MyFormFolderMyForm.xsn            

Deactivate:

stsadm.exe -o DeactivateFormTemplate -url http://MySiteCollection -filename c:MyFormFolderMyForm.xsn            

Remove:

stsadm.exe -o RemoveFormTemplate -filename c:MyFormFolderMyForm.xsn            

Remember, uploading and removing waits for the SharePoint Timer so make it work right now using:       

stsadm.exe -o execadmsvcjobs

So you, me and all that we can tell now know that managing form templates is now a batch file.

-robot


Tags:

 
 
 

Comments are closed.