Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Problem with Get(scriptresult)?

Featured Replies

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

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.

  • 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

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 ]

  • Author

Many thanks - will try this tomorrow am

cheers

simon

  • 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

You could also try the DatabaseNames function.

  • 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

Important Information

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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.