All,

I took a quick stab at the original question (off list) and since I
was stumped by the problem I poked Rafael the learn about the root of
the issue. ( So that I could learn what I missed.) I think that the
answer might help others so here is a quick write up.

The root of the issue was that the API call requires a non-null value
for the field lists to the Util.ARGetQualifier method.


The original post was about code that did this:
"
Field[] fields = null;  // not in the original post, but was in the
users code. :(
String condition = "'Status' = \"New\"";
QualifierInfo qualifier = Util.ARGetQualifier(server, condition,
fields, fields, Constants.AR_QUALCONTEXT_DEFAULT);
"

and produced:
"
MessageType: 2
MessageNum: 10000
MessageText: Error while parsing the qualifier (Error Code: 6)
AppendedText: Error position: 8
  at com.remedy.arsys.api.Proxy.ARGetQualifier(Native Method)
  at com.remedy.arsys.api.Util.ARGetQualifier(Util.java:1822)
  at br.com.icaro.ars.data.ARSForm.findEntries(ARSForm.java:271)
"


The solution was to get the fields for the form in question and pass
them into the first field array in the Util.ARGetQualifier method by
using code like the following:
"
// Field[] fields = null; // BAD... breaks Util.ARGetQualifier instead
do something like the following
// get the fields array for the "AR System Email Messages" form
(obviously use the correct form for your needs)
      NameID Schema_name = new SchemaKey("AR System Email Messages"));
      FieldFactory fieldFactory = FieldFactory.getFactory();
      FieldCriteria fCrit = new FieldCriteria();
      fCrit.setRetrieveAll(true);
      // We'd like all types of fields
      Timestamp timestamp = new Timestamp(0);
      FieldListCriteria fListCrit = new
FieldListCriteria(Schema_name, timestamp, FieldType.AR_ALL_FIELD);
      Field[] fields = FieldFactory.findObjects(context, fListCrit, fCrit);

QualifierInfo qal = Util.ARGetQualifier(context, "'179' = \"" + GuiNr
+ "\"", fields, null, Constants.AR_QUALCONTEXT_DEFAULT);
"


I would also suggest that when the Constants.AR_QUALCONTEXT_* value is
different that you likely need to pass in a NON-NULL second set of
fields too. (But that extends the original question a bit too.)



And I will try to add for the next user(s) to post an API question....

Please include in your post enough of the code so that we can see how
all of the parameters are constructed/set to the method that is
failing. It will help us to help you. :) But please not all of it, or
parts that have passwords or server names. :) ( Unless you really want
us trying to connect to your servers. :)


HTH.

--
Carey Matthew Black
Remedy Skilled Professional (RSP)
ARS = Action Request System(Remedy)

Love, then teach
Solution = People + Process + Tools
Fast, Accurate, Cheap.... Pick two.

_______________________________________________________________________________
UNSUBSCRIBE or access ARSlist Archives at www.arslist.org ARSlist:"Where the Answers 
Are"

Reply via email to