Mike, assuming you have all of your active links firing in the proper order, and that none of the mutually exclusive active links are firing at the same time (such as the two active links that set the tmpQuery field), then you should have the following:
If $Location$ = "Toronto | Houston | Sacramento |" First Round: tmpLocation = "Toronto | Houston | Sacramento |" Set tmpInt = 9 Set tmpChar = Toronto Set tmpLocation = Houston | Sacramento | Set tmpQuery = 'Location' = "Toronto" Second Round: tmpLocation = "Houston | Sacramento |" Set tmpInt = 9 Set tmpChar = Houston Set tmpLocation = Sacramento | Set tmpQuery = 'Location' = "Toronto" OR 'Location' = "Houston" Third Round: tmpLocation = "Sacramento |" Set tmpInt = 12 Set tmpChar = Sacramento Set tmpLocation = Set tmpQuery = 'Location' = "Toronto" OR 'Location' = "Houston" OR 'Location' = "Sacramento" Check your active link logging on the client and post what's going on so I can see what's happening. What's confusing me is the tmpQuery it is building is showing up as Toronto, Toronto, Houston instead of Toronto, Houston, Sacramento. I'm wondering if both Torontos are getting added in Round 1 some how, or if your tmpInt field is not getting set properly, or what. The logs will tell. Thanks, Gary Opela, Jr Sr. Remedy Developer Leader Communications, Inc. 405 736 3211 -----Original Message----- From: Action Request System discussion list(ARSList) [mailto:[EMAIL PROTECTED] On Behalf Of Micheal Gere Sent: Monday, August 27, 2007 4:03 PM To: [email protected] Subject: Re: Table Field qualification ** Hi Gary Thanks, the OR thing is eliminated but the last value is not being copied in the tmpQuery Active Link 2 of the guide: Run If: ('tmpQuery' = $NULL$) Action 1: Set Fields tmpQuery = (( "'LOCATION' = " + """") + $tmpChar$) + """" Active Link 3 of the guide: Run If: ('tmpQuery' != $NULL$) AND 'tmpArea' LIKE ("%" + "|" + "%") Action 1: Set fields tmpQuery = ((($tmpQuery$ + " OR 'LOCATION' = ") + """") + $tmpChar$) + """" Action 2: Go To Guide Label When I select the value in the LOCATION field = Toronto | Houston | Sacramento | Then I get the following result tmpchar = Sacramento tmpQuery = 'LOCATION' = " Toronto " OR 'LOCATION' = " Toronto " OR 'LOCATION' = "Houston" Thanks Mike On 8/27/07, Opela, Gary L Contr OC-ALC/ITMA <[EMAIL PROTECTED]> wrote: To address the issue of the first 'OR', you will need duplicate active links to set the tmpQuery field. The first one will run if tmpQuery = $NULL$, then set tmpQuery = "'LOCATION' = $tmpChar$" The second one will run if tmpQuery != $NULL$, then go ahead and do the set fields below of tmpQuery = $tmpQuery$ + " OR 'LOCATION' = "........ To address the second issue, you might try changing the Run-If from If $tmpLocation$ != $NULL$ AND $tmpLocation$ != " " To If $tmpLocation$ LIKE ("%" + "|" + "%") I think this might work, since you will always have a | symbol at the end of your country strings, even if the user selects only one country. Look into it and see if it will work. If it won't let us know and I'm positive we can come up with something. Thanks, Gary Opela, Jr Sr. Remedy Developer Leader Communications, Inc. 405 736 3211 -----Original Message----- From: Action Request System discussion list(ARSList) [mailto:[EMAIL PROTECTED] On Behalf Of Micheal Gere Sent: Monday, August 27, 2007 2:57 PM To: [email protected] Subject: Re: Table Field qualification ** Hi Gary Firstly thanks for your code...I tried to play with the syntax and I think I am almost there in making it work. I think there is some change required in the second active link of the guide. Appreciate your help if you can figure out something. Run If: ( 'tmpLocation' != $NULL$ ) AND ( 'tmpLocation' != " " ) Action 1: Set fields tmpQuery = ((($tmpQuery$ + " OR 'LOCATION' = ") + """") + $tmpChar$) + """" Action 2: Go To Guide Label When I select the value in the LOCATION field = Toronto | Houston | Sacramento | Then I get the following result tmpchar = Sacramento tmpQuery = OR 'LOCATION' = " Toronto " OR 'LOCATION' = "Houston" Couple of questions: 1. How do we get rid of the OR at the beginning 2. The tmpQuery doesn't seem to get the third value. I looked at the log and it doesn't fire the Active link since $tmpLocation$ != " " Thanks Mike On 8/21/07, Opela, Gary L Contr OC-ALC/ITMA <[EMAIL PROTECTED]> wrote: Okay, my suggestion is that whenever the user chooses a location, on menu/row choice, set location = location + X where X is some delimiter you choose. Next, before you do the table refresh, you need to see if that delimiter is in the location field, if it is, then use substr and strstr to parse out all of the values in that field and create a dynamic query. So, let's say that location = "Toronto | Houston | Sacremento |" You would want the table qualification to state: ('Location' = "Toronto" OR 'Location' = "Houston" OR 'Location' = "Sacremento") AND .... You will need a guide that contains the following active links: First Active Link: Set tmpLocation = $Location$ This will allow you to parse Location without modifying what the user put in the Location field Call guide below: Guide: First Active Link: Set tmpInt = STRSTR($tmpLocation$, "|") This gives you the location of the first | symbol, assuming you use | as your delimiter. Set tmpChar = RTRIM(SUBSTR($tmpLocation$, 0, $tmpInt$))) This will give you your first location, up to the first Pipe symbol Set tmpLocation = LTRIM(SUBSTR($tmpLocation$, $tmpInt$)) This will give you the rest of the location, after the first Second Active Link: If $tmpLocation$ != $NULL$ AND $tmpLocation$ != " " Set tmpQuery = $tmpQuery$ + " OR 'Location' = " + $tmpChar$ GOTO Guide Label Start Third Active Link: (this one is outside of the guide Refresh Table field Then the qualification on your table field will be: (EXTERNAL($tmpQuery$) AND ('POSITION' = $POSITION$)) Now granted, I didn't note in detail everything that needs to happen. For instance, the first time your active link rusn that sets the tmpQuery field, you will not want to have OR at the beginning of the set fields statement. You will also need to put () around your array of OR statements for the Location part of the query. Plus the syntax might be off just a bit, you'll have to play with it. It's been probably a year since I've used any of the functionality listed above, and I'm just trying to write it from memory. Thanks, Gary Opela, Jr Sr. Remedy Developer Leader Communications, Inc. 405 736 3211 -----Original Message----- From: Action Request System discussion list(ARSList) [mailto: [EMAIL PROTECTED] On Behalf Of Kaiser Norm E CIV USAF 96 CS/SCCE Sent: Tuesday, August 21, 2007 12:05 PM To: [email protected] <mailto:[email protected]> Subject: Re: Table Field qualification Why not just change the table qualification to $LOCATION$ LIKE "%" + 'LOCATION' = "%" AND $POSITION$ LIKE "%" + 'POSITION' + "%" ?? Sorry if I'm misunderstanding the issue and oversimplifying it. Norm -----Original Message----- From: Action Request System discussion list(ARSList) [mailto: [email protected] <mailto:[email protected]> ] On Behalf Of Micheal Gere Sent: Tuesday, August 21, 2007 11:31 AM To: [email protected] Subject: Table Field qualification ** Hello Everyone I hope somebody can answer this... I have a form with the following fields LOCATION - A character field with a menu append POSITION - A character field with a menu append TABLE - A table field whose source form is a JOIN form of employee location and employee position. This table gets refreshed and fetches the data based on the user selection of LOCATION and POSITION. Table qualification is (( 'LOCATION' = $LOCATION$) AND ('POSITION' = $POSITION$)) Now when the menu is appended and I have multiple values in the LOCATION and POSITION fields, how would I set the table qualification ? I am guessing it can be done using some External qualification but not sure how ? Thanks in advance for your time Gere __20060125_______________________This posting was submitted with HTML in it___ ________________________________________________________________________ _______ UNSUBSCRIBE or access ARSlist Archives at www.arslist.org ARSlist:"Where the Answers Are" ________________________________________________________________________ _______ UNSUBSCRIBE or access ARSlist Archives at www.arslist.org ARSlist:"Where the Answers Are" __20060125_______________________This posting was submitted with HTML in it___ ________________________________________________________________________ _______ UNSUBSCRIBE or access ARSlist Archives at www.arslist.org ARSlist:"Where the Answers Are" __20060125_______________________This posting was submitted with HTML in it___ _______________________________________________________________________________ UNSUBSCRIBE or access ARSlist Archives at www.arslist.org ARSlist:"Where the Answers Are"

