It's possible, though a bit complicated.
First, load the data structure for the field from the server:
my $field = ars_GetField( $ctrl, $form, $fieldId );
die "ars_GetField: $ars_errstr" if ! $field;
Then, search the "displayInstanceList" substructure for the display
instance matching the relevant view id.
foreach my $dInst ( @{$field->{displayInstanceList}{dInstanceList}} ){
if( $dInst->{vui} == $viewId ){
# Now, search the property list for property "20"
foreach my $prop( @{$dInst->{props}} ){
if( $prop->{prop} == 20 ){
print "Label: $prop->{value}\n";
last;
}
}
}
}
You might also want to use Data::Dumper to get an understanding of the
$field data structure.
use Data::Dumper;
print Data::Dumper->Dump( [$field], ['field'] );
Furthermore, note that the labels for button fields are not stored in
property "20", but "110". There are also some other special cases for
other field types.
Regards,
Thilo Stapff
Burton Simonds wrote:
> Is it possible to programically find the label names for the fields?
> While I know it is a best practice for the field name to be the same as
> the label name, unfortuately I am not in a position to enforce that
> practice, plus different views will have different labels for the same
> fields. I am looking for solutions that are either at the ARS API level
> or even at the DB level.
>
> Thank you,
> Burton Simonds
>
> --
> Burton Simonds
> bur...@co...
> Senior Systems Programmer
> America Online Release Management
> 703-265-6923
>
> "I can calculate the motion of heavenly bodies, but not the madness of people."
> ó Sir Isaac Newton
>
>
> ------------------------------------------------------------------------
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
>
>
> ------------------------------------------------------------------------
>
>
>
> --
> Arsperl-users mailing list
> Ars...@ar...
> https://lists.sourceforge.net/lists/listinfo/arsperl-users
|