Simon K Posted November 1, 2007 Share Posted November 1, 2007 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 Link to comment Share on other sites More sharing options...
comment Posted November 2, 2007 Share Posted November 2, 2007 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. Link to comment Share on other sites More sharing options...
Simon K Posted November 2, 2007 Author Share Posted November 2, 2007 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 Link to comment Share on other sites More sharing options...
comment Posted November 2, 2007 Share Posted November 2, 2007 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 ] Link to comment Share on other sites More sharing options...
Simon K Posted November 2, 2007 Author Share Posted November 2, 2007 Many thanks - will try this tomorrow am cheers simon Link to comment Share on other sites More sharing options...
Simon K Posted November 2, 2007 Author Share Posted November 2, 2007 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 Link to comment Share on other sites More sharing options...
comment Posted November 2, 2007 Share Posted November 2, 2007 You could also try the DatabaseNames function. Link to comment Share on other sites More sharing options...
Simon K Posted November 2, 2007 Author Share Posted November 2, 2007 oh right changed it for: not IsEmpty (FilterValues (DatabaseNames;"contacts")) Once again thanks for all your help Link to comment Share on other sites More sharing options...
Recommended Posts
This topic is 6161 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now