I am trying to use setDescription but it is not working.
IWDatacapture.getItem("/test/something").setDescription("hello");
this piece of code is not working..I dont see javascript errors.
Teamsite version: 7.4.1
OS : Windows server 2008 R2
In past versions, you couldn't set a description in FormAPI if there wasn't one before (in the DCT). Your DCT needed at least a <description> </description> so that the (?) button got created, and then you could use FormAPI to set a proper value. Might be similar in 7.4.1.
If that's not it, you're going to have to provide a lot more information about your code and how you tried debugging it so far.
From what I can tell, in 7.4.0 on W2K3 - setDescription simply doesn't work.
I tried with both an "iwov" and "xml" DCT - for the latter, I modified the example xml/press-release DCT to include the following code:
<script> IWEventRegistry.addFormHandler("onFormInit", init); function init() { IWDatacapture.getItem("/press-release/head/title").setValue("Testing"); IWDatacapture.getItem("/press-release/head/title").setDescription("Another Test"); IWDatacapture.getItem("/press-release/head/title").setValue("Testing2"); } </script>
(the two setValues were an alternative to using alerts - to make sure the second one got executed)
The result was that the value was set but the description (which is hard-coded in the actual item to "This is the title of the press release. Make it hook people in!") did not get changed at all - it remained as originally coded.
You should probably run the same kind of test with a very simple DCT and embedded FormAPI code - verify that it does not work, and then submit that information to Support and see if they can reproduce the problem in-house and then file a defect report on it.
This seems to be a defect.