Topic Options
Rate This Topic
#61487 - 01/30/03 02:21 AM ARGetListSQL: Field ID to Field Name
macdalmore Offline
Just Signed Up

Registered: 01/28/03
Posts: 4
Hi guys,

I am fairly new to Remedy. I am currently using the Java API and have run into problems with the ARGetListSQL function in the com.remedy.arsys.api.Util. The method expects a valid SQL statement. I was able to run something like "SELECT * FROM <MYSCHEMANAME>". But when I try to retrieve data for a particular field using the FieldID it doesn't work.
Say I have field called "Customer" with internal ID "10008". If I try "SELECT 10008 FROM <MYSCHEMANAME>" it fails (well actually it returns a result array containing 10008 in all rows), only if I do "SELECT Customer FROM <MYSCHEMANAME>" I get what I want.

Now my problem is that I haven't found a way to obtain the field name (i.e. Customer) on the basis of the internal field ID (say 10008).

Help would be greatly appreciated !

Thanks,

MacD

Top
#61488 - 01/31/03 12:06 AM Re: ARGetListSQL: Field ID to Field Name [Re: tooltime]
Matt Reinfeldt Offline
Old Hand
***

Registered: 06/12/01
Posts: 1419
Loc: Madison, WI
MacD,

I haven't played with the Java API yet, however... there're two ways you can go about this... you could, ahead of time, do the following query:
SELECT SCHEMAID FROM ARSCHEMA WHERE NAME = '<YOURSCHEMANAME>'
That will allow you to run the following query, which is what you want:
SELECT C100008 FROM T<schemaid>

make sense? Your other option is to load an array of all fields on the form (ars_GetListFields ??) and then find the id(s) of the field name(s) you need to query...

Hope that helps!
_________________________
Matt Reinfeldt
I belong to the following Professional Networks:
http://www.naymz.com/search/matt/reinfeldt/1524717
http://www.linkedin.com/in/mreinfeldt

Top