November 1, 200718 yr I have an application where the contacts are stored in one file and tasks are stored in another. Within the "tasks" file, on creating a new task I wish to enable the user to search for the org id eg as follows: script in tasks: perform script "quick lookup" from file "contacts" Set field tasks::org_id; get(scriptresult) Scripts in contacts: quick lookup (abbreviated): new window go to layout "quick lookup" loop Pause/resume script(indefinitely) end loop select company triggered by clicking on an item in the found list on quick look up layout set variable $chosenid; orgid close window (current window) exit script (result;$chosenid) MY problem currently seem manifold but the main one is that at the point i return to the main scirpt the get(scriptresult) value is blank Secondly there seems to be no consistency in whether i end up in the tasks file or the contacts file? (both files have quite long startup scripts) Any pointers most gratefully received. thanks simon
November 2, 200718 yr I am only guessing here, but it looks like 'select company' is NOT a subscript of your 'script in tasks' - or of any other script.
November 2, 200718 yr Author i am not sure about "sub scripts" - the "select company" script is not called by a "parent script" it operates independently in response to a user clicking on a field on the "quick lookup" layout and is supposed to deliver the org id , and of course halt the loop... (which it doesnt seem to do either) does this help or would you like/need more info many thanks s
November 2, 200718 yr That seems to be the problem - a script result is passed by a subscript to the calling parent script. Your script passes its result to thin air. I think (haven't tested it) something like this should work: QUICK LOOKUP New Window Go to Layout [ "Quick Lookup" ] Set Variable [ $$chosenID ; "" ] Loop Exit Loop If [ not IsEmpty ( $$chosenID ] Pause/Resume Script [indefinitely] End Loop Exit Script [ Result ; $$chosenID ] SELECT COMPANY (set the button to Resume paused scripts) Set Variable [ $$chosenID ; OrgID ] Close Window [ Current Window ]
November 2, 200718 yr Author Comment, Many thanks for the suggested scripts - in the event I thought I would try something your ideas suggested to me: On the select company script i changed the button setting to "exit" current script - and everything seems to work the only thing that seems to mess up is if the orgs file is not open before the quick lookup script runs. I have put a line in as follows: If ValueCount(WindowNames("contacts"))<1 is this the best way to check for a file being open? Once again thanks for all your help Simon
November 2, 200718 yr Author oh right changed it for: not IsEmpty (FilterValues (DatabaseNames;"contacts")) Once again thanks for all your help
Create an account or sign in to comment