October 11, 200421 yr I have a script that does the following: ------------------------------ Goto Layout [xxx1] Enter find mode [pause] if ("case_status") <> "") <---- case status is a radio button on the search form, either 'open' or 'closed' ...if ("case_status" = "Open") .....Goto layout [xxx2] .....Insert Calculated Result ["Closing date", ""=""] ...End if ...if ("case_status" = "Closed") .....Omit Record .....New Record/Request .....Insert Calculated Result ["Closing date", ""=""] ...End if End if Perform Find [replace found set] Goto layout[xxx3] ------------------------------- Right now I'm just concerned with the 'open' case. What it's supposed to do is put the "=" in the closing date field in the find request. It does successfully, but it doesn't act the same as if I type it in manually in find mode. I've had quirky problems with finds/insert calculated result/set field before but this is the first for me that I can actually see the exact criteria it uses to search and does something opposite of what I have expected. More specificly it comes back with no matches, yet when I serach manually it works just fine. Another thing to note is "case_status" is just a blank text field I'm using to do searches. I forgot that you can't search with global fields, so this is my mini-work around. This field does it's job properly, as the nested ifs work fine, it's jut the search itself doesn't work correctly.
October 11, 200421 yr I would probably use the "Insert Text" step instead and see what the result is. OBTW, unless "case_status" is a global field, you can't test it in find mode. -bd
October 11, 200421 yr Just for clarification: an equals sign followed by nothing means that you are searching for records that do not have a closing date. Is that correct? One suggestion would be a step at the beginning of the script to show all records.
October 11, 200421 yr Since you're pausing before the tests, I'm assuming you're testing whether case_status has been selected by the user during the find. I would use not IsEmpty(case_status) versus case_status <> "". I would also Set Field [case_status, ""] after you test it, or it will part of the find's criteria. You're not going to the 2nd layout in your second If. If closing date is not on xxx1, then your Insert step will have no effect here. Try using Allow User Abort [Off] Set Error Capture [On] Goto Layout [xxx1] Enter Find Mode [Pause] If [not IsEmpty(case_status)] ..Goto layout [xxx2] ..If [case_status = "Closed"] ....Omit Record ....New Record/Request ..End If ..Insert Calculated Result [Closing date, "="] End If Go to Record/Request/Page [First] Set Field [case_status, ""] Perform Find [Replace found set] If [status(CurrentFoundCount)] ..Go to Layout[xxx3] Else ..Show Custom Dialog ["No records were found."] ..Show All Records ..Go to Layout [Original] End If An alternative would be to make case_status a global field and have the criteria entered in Browse Mode.
Create an account or sign in to comment