Is there anybody that can help with this?
Hi all,my environment is TS 672 SP2 on Windows 2003.I have a datacapture template that, using a CGI callout, runs a PERL script that should automatically populate a DCT field. DCT type is "iwov".In my PERL script I get the "iw_item_name" value that should return the name of the field where I have to set the value.The problem is that the iw_item_name returns the following value: "chiaviricerca/0/idreplicant" but the field name is "chiaviricerca/31/idreplicant".I can't understand what I'm doing wrong. Is there anybody that can help with this?
use TeamSite::CGI_lite;use CGI qw(:standard);$ip = '10.14.60.156';# begin the cgitask$|=1;$cgi = TeamSite::CGI_lite->new();$cgi->parse_data();my $form_name = $cgi->{'form'}{'iw_form_name'};my $element_name = $cgi->{'form'}{'iw_callback_var'};my $user_name = $cgi->{'form'}{'user_name'};my $item_name = $cgi->{'form'}{'iw_item_name'};my $item_description = $cgi->{'form'}{'iw_item_description'};my $dcr_name = $cgi->{'form'}{'iw_object_name'};my $workarea = $cgi->{'form'}{'area_path'};my $dcrtype = $cgi->{'form'}{'iw_dcr_type'};my $Action = $cgi->{'form'}{'Action'};....
Sorry I forgot to add the CGI code.Here it is: use TeamSite::CGI_lite;use CGI qw(:standard);$ip = '10.14.60.156';# begin the cgitask$|=1;$cgi = TeamSite::CGI_lite->new();$cgi->parse_data();my $form_name = $cgi->{'form'}{'iw_form_name'};my $element_name = $cgi->{'form'}{'iw_callback_var'};my $user_name = $cgi->{'form'}{'user_name'};my $item_name = $cgi->{'form'}{'iw_item_name'};my $item_description = $cgi->{'form'}{'iw_item_description'};my $dcr_name = $cgi->{'form'}{'iw_object_name'};my $workarea = $cgi->{'form'}{'area_path'};my $dcrtype = $cgi->{'form'}{'iw_dcr_type'};my $Action = $cgi->{'form'}{'Action'};....
"chiaviricerca/0/idreplicant"
"chiaviricerca[1]/idreplicant"
/x/
[x+1]/
Hi,Could you please post the snippet of code which retrives the value,I am also struck here in the same placeWarm RegardsLal
my $element_name = $cgi->{'form'}{'iw_item_name'};my %num = ();while ($element_name =~ m!/([0-9]+)/!g) { my $num = $1; $num{$num} = $num + 1;}foreach my $key (keys %num) { my $num = $num{$key}; $element_name =~ s!/$key/![$num]/!;}
Use the below code snippet to solve the issuemy $element_name = $cgi->{'form'}{'iw_item_name'};my %num = ();while ($element_name =~ m!/([0-9]+)/!g) { my $idx = $1; $num{$idx} = $idx + 1;}foreach my $key (keys %num) { my $idx = $num{$key}; $element_name =~ s!/$key/![$idx]/!;}
my $element_name = $cgi->{'form'}{'iw_item_name'};my %num = ();while ($element_name =~ m!/([0-9]+)/!g) { my $idx = $1; $num{$idx} = $idx + 1;}foreach my $key (keys %num) { my $idx = $num{$key}; $element_name =~ s!/$key/![$idx]/!;}
my $element_name = $cgi->{form}{iw_item_name};while ($element_name =~ m!/(\d+)/!) { my $x = $1 + 1; $element_name =~ s!/(\d+)/![$x]/!;}
$element_name =~ s!/(\d+)/![$1+1]/!eg;