Environment: Win2K Server/TS5.5.2 SP3
I am attempting to use FormAPI to read a value from a text file and assign that value to a field on the DCT. To accomplish this I am using IWDatacapture.callServer() with a small perl script. This is the perl I am using:
---begin bepsfaq_get_id.ipl---
#!D:\iw-home/iw-perl/bin/iwperl
use strict;
open(FIDLIST, "<d:\\iw-home\\local\\bin\\bepsfaq\\bepsfaq_id.txt");
my $faqID = <FIDLIST>;
my $newFaqID = $faqID + 1;
print <<"END";
<html>
<body onload='parent.getScriptFrame().IWDatacapture.getItem("/faqID").setValue("$newFaqID")'/>
</html>
END
close(FIDLIST);
open(FIDLIST, ">d:\\iw-home\\local\\bin\\bepsfaq\\bepsfaq_id.txt");
print FIDLIST $newFaqID;
close(FIDLIST);
return;
---end bepsfaq_get_id.ipl---
The bepsfaq_id.txt file contains a single line which is a number.
And this is the relevant portions of the DCT (I wasn't sure if a parameters object was absolutely required or not so I just created a meaningless one):
<script Language="JavaScript">
<![CDATA[
[...]
var parameters = new Object();
parameters.dummy="nothing";
IWDatacapture.callServer("/iw-bin/bepsfaq_get_id.ipl",parameters,true);
[...]
]]>
</script>
<item name="faqID">
<label>FAQ ID:</label>
<description>This is a read-only field</description>
<text></text>
</item>
I know the perl is executed because the value in the file is indeed updated. However, the "faqID" field is never populated with the value which is read from the file. I am probably missing something obvious here and hopefully someone can point me to my error. I've read through all the posts I could find on this forum about callServer() and tried all of the suggestions to no avail.
Thanks,
Darryl