Extension: Call Procedures In a different Screen

xyz.kumaraswamy.fun.aix (4.8 KB)

Extension that can call Procedures located in another screen.


blocks

This is the procedure on Screen1 which will be called with an arg.
Make sure to first include the extension on the screen you will be calling on.


And on any other screen, you use the block "Invoke" passing the screen name it's located in with the procedure name and the arguments if any.

Conditions

Suppose you want to call a procedure located in Screen2, then the extension must also be present there and the screen must be atleast opened once before the procedures on that screen can be accessed by the extension.


Hope this helps you.

10 Likes

Hi, this a great extension for calling Procedures dynamically - even procedures defined in the the same screen as the procedure Call.

Screenshot from 2025-11-03 17-24-31

Unfortunately this seems to work (very well!) only in the built Application. AI Companion use of the Fun 'Invoke' block produces an error - cannot find procedure /procName/, and if calling Procedure defined in another screen: cannot find the Screen /screenName/, so is impossible to test in companionMode!

Is there a known/possible solution I could try to get Fun's Invoke-block to 'find' the named procedure in Companion?
All help gratefully received.
C.

Hi, we cannot do that since the companion only loads the procedures for the current screen; therefore, the procedures defined in other screens are practically nonexistent until that particular screen is opened.

Kumaraswamy

Hi Kumaraswamy,
Thanks for replying so promptly. In my app, the Invoke block refers to 'Screen1' which is where the named procedure is defined. This works perfectly in the built app, but always in Companion it 'cannot find the procedure' - even though it's in the same screen!

I just wondered if there might be a special procedure-name prefix/suffix for my procedureName that Companion (maybe in a lookup) would recognise when the Invoke block passes the name. If so, then I could test my app fully, and then amend the Invoke name back for build purposes - where Fun works flawlessly!
C.

Oh, in that case, I'll try to write a quick fix tomorrow.