Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

"Layout Name By Calculation" and DDR


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

Recommended Posts

Posted

Here are a couple of potential "gotchas" that got me recently.

This may already be documented somewhere, but it seems like the Database Design Report (DDR) does not detect references to layouts that are specified using the "Layout Name By Calculation" option in the GoToLayout script step.

Also, if you rename a layout, any references to that layout using the "Layout Name By Calculation" option do not get updated automatically. This can produce some unexpected navigational redirects in a solution and can prove difficult to track down, especially since these layout references aren't captured in the DDR.

Posted

Are you talking about the HTML DDR version? Because in the XML version the layout reference by calc in a script step is right here:

Go to Layout ["ppt_container_1" ]

"ppt_container_1"

"ppt_container_1"

Using the XML DDR it's easy enough to find all instances of "Go to Layout" and find out if it's using a calc, then reading the calc for existing layout names.

In a lot of ways the XML DDR is a much better tool than the HTML one.

Posted

What I'm referring to is that in the Layouts section of the DDR, where it lists the scripts that each layout is referenced in, it will not detect that the layout is referenced in a script if the only reference to the layout in that script is in the 'Layout Name By Calculation' option.

Posted

Yep, but it is listed in the section I mentioned. So you can extract the data if you need it.

The reason it's not in the layout section is that when you specify a layout by calc, you're not actually referencing the layout as an object. You have a calc that results in a string and that strings needs to be evaluated at runtime to see if it matches a layout name.

The calc could reference a field or a variable instead of a hard-coded layout name.

Posted (edited)

Fair enough, and it is good to know that there is a workaround in the case of finding complete layout references in the DDR. But unless this is documented somewhere, it is going to be a 'gotcha' for many FM developers that they cannot simply take the layout summary information in the DDR at face value in this situation--they have to work a little harder to determine everywhere that a layout is referenced.

And who knows, maybe FileMaker will be able to figure out a way to improve this in subsequent releases of the DDR. I expect it should be possible to program for the detection of certain hard-coded references in a 'Layout Name By Calculation' calculation. For example, if a Case statement is used, and one of the results is a single string text expression, then chances are this text expression is a layout name (or at least an attempt at specifying a layout name). However, calculations that reference a field are going to be more complicated, especially for a field that accepts user input on the fly somewhere in the solution. But it wouldn't surprise me if FileMaker figures out how to address this appropriately at some point.

Anyway, at the very least, a statement at the beginning of the layout section of the DDR identifying those scripts in which layout name is specified by calculation would be a useful alert, just to let the Developer know that there are additional scripts where layouts may be referenced.

Regarding the second gotcha, it might also be helpful if an alert message could be displayed everytime a layout name is changed IF there are occurrences of 'Layout Name by Calculation' anywhere in the solution. The alert could simply list where 'Layout Name by Calculation' is used and advise the user to verify that these occurrences still work properly with the renamed layout.

Edited by Guest

This topic is 6969 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.