New Window sizing and options, Card from a card?

As I continue tweaking my solution, I'm encountering little things I need to clean up.

I have a layout of a song list. The clicking on Song Title invokes a script that opens the related record from Songbook in a card using the Songbook layout. That works great!

The Songbook layout has a portal of musicians related to that song, which also works fine.
The catch comes when on that portal, I want to add a musician (highlighted + button).

When I open the Songbook layout directly this works fine. It's when the Songbook layout is displayed in a card and I need to open an additional card.

The + button on the Songbook layout invokes a script which opens a card.

However, when this is used from the previously mentioned layout via the script, another iteration of the Songbook layout opens in the same window (card).

I've tried using Dialog, Floating Document, etc., but those all show scroll bars and the toolbar which is not clean and which makes sizing the window cumbersome. I've also tried using a calculation for the height/width of the window based on an object which is the size of the entire layout.

Failing being able to open a card from a card, can someone recommend a way to accomplish this?



Please post the script that calls the card window.

Sorry about that - I mean to include the script in my OP.

This script created a new Window whose style is Dialog, but you talked about creating a card from a card.

Can you show the script invoking the second card please ? An better all the scripts starting the one that creates the first card. And please provide a screen shot regarding

However, when this is used from the previously mentioned layout via the script, another iteration of the Songbook layout opens in the same window (card).


1 Like

As I mentioned earlier, the script from the original layout (which itself is in a card) opens the same layout in a new card. So the script was changed to open a dialog which I'm trying to edit.

This script is invoked from the songlist by clicking the song title; it brings up the Songbook layout.

On the Songbook layout (in the card) this script currently creates a new Songbook records in a card layout, rather than opening the Add a Musician card (e.g., goal is to open a card from a card).

Some logic needs to be wrapped around it to avoid creating new blank records.

You need to do some debugging. In your script capture errors that may happen and display a custom dialog with the error number.

One other way is to start the debugger and check the box to stop on error.

You will then get clues.

1 Like

You can't create a card window from a card window. A card window always belongs to a parent window. Only one card window can exist per parent window.


I thought as much from my test. Seems the best solution is a card and then a dialog from the card. Sizing and window attributes on the card are a problem inasmuch as I don’t want any toolbars on the dialog.

At the beginning of a lot of my OpenNewWindow as Card type scripts, I use the Get(WindowStyle) function to determine if the Context is already a Card Window - if it is, the script will navigate to the required Card layout, rather than try and open a new Card... might be of help?...


@JamesG , just to clarify. If the Context is already a Card Window, what are the mechanics of getting to the (new) card layout? I've had some success with just changing the 2nd card to a dialog instead of a card which opens the layout with the same dimensions the card would have used - I just don't like the toolbars and such that come along with it. In terms of navigating to to the Card layout, it seems I'm stuck on the first card until I close it.

You can't change the WindowType from 'Card' to 'Dialog' - I'm just suggesting switching layouts, rather than opening a new window, when the script is run whilst a Card Window is the active context. Here's an example of the script steps:


Cool! Thanks!

This test and the follow-on behaviour is important when you have multi-layout workflows in a card window.


Matt Petrowsky, a long time ago, came up with a technique to open a second card window. If I remember it correctly, he opened a new window off screen and then a card window from that psitioned wher it could be seen, thus creating two or more card windows. The caveat was to name the off-screen window and have a button on the card window that would close it and the window it was attached to. I believe he gave an example of having multiple card windows open at the same time.

One trick that I use quite often is to have multiple layouts exactly the same sizze. I can thus open one up as a card window and then have buttons on it to go to another identially sized layout with buttons (positioned in exactly the same place) to go to the previou layout or to another one. That way the user sees only one card window but can go right back to where they were and there is no jump. (To facilitate this process, I created a default screen with all elements positioned where I want them,..Then all I have to do is duplicate that layout rename it and set the context.

1 Like