Jump to content

Problem with Get(scriptresult)?

This topic is 6078 days old. Please don't post here. Open a new topic instead.

Recommended Posts

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


new window

go to layout "quick lookup"


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.



Link to comment
Share on other sites

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


Link to comment
Share on other sites

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:


New Window

Go to Layout [ "Quick Lookup" ]

Set Variable [ $$chosenID ; "" ]


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


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


Link to comment
Share on other sites

This topic is 6078 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.