RE: [Arsperl-users] question regarding the query() method
Brought to you by:
jeffmurphy
|
From: Kelly L. <kel...@ra...> - 2005-04-27 14:03:16
|
Good day Tom,
I'm not as hep on the OO code, but in general you need to translate a =
text
qualifier into the functional code that Remedy uses.
Here's a code snippet of mine:
-------------------------------
my $qualString =3D '\'Status\' =3D 0 OR \'Completed Date\' =3D $NULL$ OR
\'Completed Date\' > $TIMESTAMP$ - (32*24*60*60)';
my $qual =3D ars_LoadQualifier($ctl, $cmsPlanServicesForm, $qualString) =
||
terminalExit("ERROR: failed in ars_LoadQualifier()\n$ars_errstr");
if (defined($qual)) {
%entries =3D ars_GetListEntry($ctl, $cmsPlanServicesForm, $qual, 0,
0);
} else {
terminalExit("failed in ars_LoadQualifier for
$qualString\n$ars_errstr");
}
-------------------------------
I just use the $qualString for convenience sake.
After you 'load' the qualifier, you use that encoded string in your =
query.
Note also the $ars_errstr - This is always worth checking if you think
something went wrong.
Hope that helps. Feel free to contact me for details on this.
Kelly Logan
Cybernetic Solutions, Inc.
(313) 586-8334
kel...@cy...
-----Original Message-----
From: ars...@ar...
[mailto:ars...@ar...] On Behalf Of the sign will be =
that
life is awesome
Sent: 04/27/2005 6:16 AM
To: ars...@ar...
Subject: [Arsperl-users] question regarding the query() method
I'm trying to figure out how to properly use qualifiers via the OO =
query()
method on the SHR:People form. my code is below :
my @entries =3D $remedy_form->query(
-query =3D> '("Login Name" =3D "some_user")'
);
this returns an array of field headers but no entries.
i've verified that the 'Login Name' field exists under that name in the =
form
'Login Name' =3D> 240000005
I suspect that I'm not understanding how to properly phrase a remedy =
query
and apologize if that is the case here. invoking query() with no =
arguments
properly returns all entry IDs for the form and i can properly perform a
get() on the form handle to retrieve the entry - i just can't seem to
properly format a filter on the query itself.
does anyone see anything boneheaded i'm doing here? i've tried various
quoting styles for the query, such as "(\"Login Name\" =3D =
\"some_user\")",
'Login name' and 'Login' instead of 'Login Name' and omitting the spaces
between the field name and the '=3D' in the query as well as removing =
the
parentheses around the query but none of those seem to work for me.
directly using ars_GetListEntry acts identically.
one thing i've noted ( not sure if this is something the C API deals =
with or
not ) is that you can specify any field name in the qualifier, whether =
it
exists or not, and no error is thrown.
the deconstructed qualifier as returned by ars_perl_qualifier() looks =
like
$VAR1 =3D {
'oper' =3D> 'rel_op',
'rel_op' =3D> {
'left' =3D> {
'value' =3D> 'Login Name'
},
'right' =3D> {
'value' =3D> 'some_user'
},
'oper' =3D> '=3D=3D'
}
};
using the standard $all qualifier of "1=3D1" returns
$VAR1 =3D {
'oper' =3D> 'rel_op',
'rel_op' =3D> {
'left' =3D> {
'value' =3D> 1
},
'right' =3D> {
'value' =3D> 1
},
'oper' =3D> '=3D=3D'
}
};
( using "1=3D1" returns all entries properly, as does "1<2" and other =
queries
of that nature, so i think i've at least got the basic syntax down. =
what
i'm probably not understanding are what types of arguments i'm supposed =
to
feed to the qualifier constructor, tho the examples i've seen in the =
mailing
list seem to match up with what i'm trying to do )
a little stumped :) - thanks much for any help!
- tom
-------------------------------------------------------
SF.Net email is sponsored by: Tell us your software development plans! =
Take
this survey and enter to win a one-year sub to SourceForge.net Plus =
IDC's
2005 look-ahead and a copy of this survey Click here to start!
http://www.idcswdc.com/cgi-bin/survey?id=3D105hix
_______________________________________________
Arsperl-users mailing list
Ars...@ar...
https://lists.sourceforge.net/lists/listinfo/arsperl-users
|