Re: [Arsperl-users] question regarding the query() method
Brought to you by:
jeffmurphy
|
From: <ix...@on...> - 2005-04-27 18:58:59
|
> ARS "Advanced Search Bar" syntax goes something like this: > Field names (Current View's Label, or fields DB name) should be in > single quotes. (Or you can use the field ID too.) > Literal strings should be in double quotes. > integers are NOT quoted (double or single) > Spacing really does not matter that much. (Extra white space is > welcome, but sometimes "2AND" may not parse as well as "2 AND". So try > to use some white space or at least parentheses.) > > > API search strings only differ by this one simple (and easy to trip > over) difference: > The fields DATABASE NAME (Each field has multiple English names, > one for the DB name that is guaranteed to be unique on the form, and > one per view where the field is included for the users reference.) > should be in single quotes. > > > So if the field id is 240000005 and the fields DB name is 'Login Name' > the following two syntax should do the same thing: > > 'Login Name' = "some user" > > vs. > > '240000005' = "some user" > > > However, if the fields label (view dependent name) is actually 'Login > Name' and the field's DB name is 'Login' then the first example above > would fail and the second one should work. (and 'Login' = "some user" > should also work.) thanks to everyone for all the fast feedback! .. after posting last night i did discover that retrieving a mapping of the field entries to field ids via ars_GetFieldTable() and using the field id itself works fine for all cases i could think to throw at it. - '240000005' = "some_user" '240000005' like "%some%" etc when trying to enclose 'Login Name' in single quotes, i receive : EXCEPTION : type => 2 message => [ERROR] Unknown field referenced in query line (position 14 (( 'Login name'^ = "some_user" ))) (ARERR #1587) examining the form with remedy administrator, the ID is listed as '240000005' and the 'Name' is shown as 'Login Name' in the Database tab under Field Properties, so maybe i'm not looking in the proper place for the database name? for the time being things are fine so long as i've an easy way to form queries by caching the field ids via ars_GetFieldTable() - much better than dumping the entire database and post-filtering, heheh now all i've left to figure out is ars_GetListSchema() and i think i'll have everything i need to do what i want to do :) thanks again everyone! - tom |