June 8, 200520 yr Newbies Hello, Problaby a newbie question, but I a would like to save requests for future use, so that the requests can be brought up and performed again. I would like to be able to store the request in a table with other request, so the user can search through that table, chose for a request and do a perform/find. How do I do that?
June 8, 200520 yr eke! This is harder than it should be, I'm sure some kind soul will come by with smething better! (There is a copy record script step but not a paste as record script step so you can't just abuse the clipboard.) You could iterate through the fields with a script like: If [ not Get ( ScriptParameter ) ] # 1. First set up the iteration through the tab order Go to Layout [ thisLayout ] Go to Next Field #...goes to first field in tab order Perform Script [ "thisScript" ; Parameter: Get ( ActiveFeidlName ) & " unique.sub.seperator " & Get ( ActiveFieldContents ) & " unique.parameter.seperator " ] Else If [ Exact ( LeftWords ( Get ( ScriptParameter ) ; 1 ) ; "Save.this.Search" ] # 3. Now take the gathered data and plop it into the search table Enter Browse Mode Go to Layout [ searchesLayout ] New Record/Request Perform Script [ "buildTheSearch.Record" ; Parameter: RightWords ( Get ( ScriptParameter ) ; WordCount ( Get ( ScriptParameter ) - 1 ) ) ] Else # 2. Iterate each field in the tab order and load the scriptparameter with the search data Go to Next Record If [ Exact ( Get ( ActiveFieldName ) ; "firstFieldInLayout" ) ] Perform Script [ "thisScript" ; Parameter: "Save.this.Search " & Get ( ScriptParameter ) ] Else Perform Script [ "thisScript" ; Parameter: Get ( ScriptParameter ) & Get ( ActiveFeidlName ) & " unique.sub.seperator " & Get ( ActiveFieldContents ) & " unique.parameter.seperator " ] End If End If And then build the search record, ... the search table has fields: key search.id field.name search.string and then (*phew*, there's more??)... return to the first layout, rebuild the search from the search record, and run the find. Provide a search button to do the starting script. but this still is incomplete because: this won't handle OR searches (mutli-record find requests) without making it even more complicated it's reliant on "firstFieldInLayoutOrder" in the script, so you have to precalculate this name and add it to the script parameter bit unless you want to write a script like this for each searchable table in the relationships graph. this doesn't provide a pretty means to casually select and rerun the search ... you'd have to write a script to iterate through the search records in find mode on the searchable layout (so each search table's field will need a value list) ...but it's what I've got just now
Create an account or sign in to comment