Jump to content
Salesforce and other SMB Solutions are coming soon. ×

Unstored repeating field used to work now broken


Tim Harris

Recommended Posts

We have for a long time been using the technique based on the 24U for Scripted tab control design. This has been working fine for a number of year. We now use 8.5, but I have confirmed that this problem also exists on 9.0

 

For a long time we have some layouts, some with 5 tabs some with 4. We have recently increased this by adding an extra tab to each and the problem exists on all databases. All existing tabs work fine, but the new ones don't function correctly in that the Field "Ledger_CompanyTabNumber" which has in one example 5 repeating fields, only the first three are correct, 4 and 5 are "?"

 

Here is the line of design that is causing us problems.

 

Ledger_CompanyTabNumber Unstored,from Ledger,=Let($$_active_tab = Get ( CalculationRepetitionNumber ); GetNthRecord ( (Ledger_CompanyList); $$_active_tab)),Evaluate even is all referenced fields are empty.

 

Field type is Calculation(Number)[5]

 

Ledger_CompanyList is a global repeating field of names.

 

So, when there were repeating fields of 4 of both the Ledger_CompanyList and Ledger_CompanyTabNumber - all was fine. The field was updated as people would move from tab to tab (so tab A would have Ledger_CompanyTabNumber[1] is it layout, tab B Ledger_CompanyTabNumber[2], etc. For tab A,B,C & D the all five of the Ledger_CompanyTabNumber fields would match Ledger_CompanyList. However, for layout E where Ledger_CompanyTabNumber[5] is showing, only Ledger_CompanyTabNumber[1-3] are correct, 4 and 5 are '?'. If I create new the field definitions e.g. Ledger_CompanyList_test, etc, I get exactly the same results - except the last two fields are blank and do not have '?'.

 

Exactly the same problem using another layout on another file that has anoher database in it.

 

Ideas anyone?

Link to comment
Share on other sites

Let me just reformat that line so its easier to read...

 

Let (

$$_active_tab = Get ( CalculationRepetitionNumber )

;

GetNthRecord ( Extend ( Ledger_CompanyList ) ; $$_active_tab )

 

)

 

Looking @ the 24U example file I assume forgetting the Extend is just a typo?

 

 

Let me try and understand the situation correctly.

 

Ledger_CompanyList is the global repeating field you have placed on top of your tab control objects and contains the "soft coded" tab names correct?

 

Ledger_CompanyTabNumber is a repeating field you place in each tab (only 1 repetition per tab, #s corresponding) that you use to script navigation to tabs correct?

 

 

Now, just looking @ the calc above, what it looks to be doing as far as I can see is when you navigate to a tab, the calc re-evaluates, and since only 1 repetition is showing on a tab, it evaluates on that repetition. $$active_tab is set to the repeiition # which is all fine, but then the calc actually sets its contents to the corresponding name in the corresponding repetition of Ledger_CompanyList correct?

 

So basically you have Ledger_CompanyList with 5 names in it used as tab names, then on each tab you place ONE repetition from Ledger_CompayTabNumber, and it displays the tab name correct?

 

However after you specify a name inside repetitions 4 and 5 of Ledger_CompanyList, and you then place Ledger_CompanyTabList on those 1/2 new tabs (MAKING SURE the repetition on those tabs is 4/5 respectively...) They are "?" .

 

 

• Did you set the global repeating field Ledger_CompanyList offline, then put the database up on a server? If so be sure to take the database off filemaker server to set the other 2 repetitions. Globals can only be set offline, each time you relaunch the database they'd reset to empty otherwise.

 

•*Make sure that calc above has Extend and it wasnt just a typo...

Link to comment
Share on other sites

hi - and thanks for the reply.

 

I have not used the Extend as the Ledger_CompanyList is simply a repeating field in the database defined as Global [5]. In my database the tabs names are hard coded as there was no need to use the overlay example.

 

It is correct that Ledger_CompanyTabNumber is a repeating field (only 1 repetition per tab, #s corresponding) that is used to script navigation to tabs.

 

..... sets its contents to the corresponding name in the corresponding repetition of Ledger_CompanyList correct? Yes correct, that is the idea.

 

However after I specify a name inside repetitions 5 of Ledger_CompanyList, and you then place Ledger_CompanyTabList on that new tab (MAKING SURE the repetition on those tabs is 5 respectively...) It is "?" .

 

Existing repetitions 1 to 4 are fine and if I display all 5 elements of the repeating field Ledger_CompanyTabNumber on the layout, I see that it is correctly populated in all five cells with the correct data when tabs 1 to 4 are selected. Only when I select tab 5 does Ledger_CompanyTabNumber[4] and [5] have '?' in them.

 

Global field was set correctly off line and also tested as non served file.

 

Whilst the Extend is not needed in this example, I can confirm I have tried it both with and without in being there.

Link to comment
Share on other sites

Tim,

 

Maybe you can clarify what this field is actually for. Are these labels or are they tracking the tab number someone is on (I don't have the example file to examine)?

Link to comment
Share on other sites

We use it to track the tab that is active (i.e. the one that someone is actually on). If they change tabs we can track that and then provide data that is relative to the actual tab they are on. Been working fine for about two/three years. Adding the extra tab and repeating field is the problem in that the field is not being updated correctly.

 

Tabs 1 to 4 are fine, tab 5 the new one fails to write the correct data into the fields 4 & 5.

Link to comment
Share on other sites

I found the example you were referring to:

 

http://www.24usoftware.com/TabControl#download

 

Notice that in their implementation, they use a separate table to hold the tab names, and that's what's being referred to in the calc:

 

Let(

$$_active_tab = Get(CalculationRepetitionNumber);

 

GetNthRecord(Extend(TabNames::TabName); $$_active_tab)

 

)

 

Without that, the GetNthRecord() doesn't make sense. So when I look at your version, it seems you're just using a single local field with a list of items in it. This can work too, but then you don't need the GetNthRecord(). Instead you'd use GetValue() if it's a list (I think you'd also need the Extend()) or refer to the repetition if it's a repeating field.

Link to comment
Share on other sites

Thanks.

 

I have tried GetValue() both with and without Extend and in only returns the name on the first field of the repeating Ledger_CompanyList all tabs not just tab 5.

 

For both examples the $$_active_tab is being correctly set to the tab number and so as a work around I'm using GetRepetition(Ledger_CompanyList ;$$_active_tab) to get back to the tab name that should be in there in the first place.

Link to comment
Share on other sites

Like I said, if it's a repeating field, you'd reference the repetition directly, like:

 

Let(

$$_active_tab = Get(CalculationRepetitionNumber);

 

Ledger_CompanyList[$$_active_tab]

 

)

Link to comment
Share on other sites

Wow - works like a dream. I guess older versions of filemaker may have been more tolerant to bad coding like mine.

 

Thanks for the advice.

Link to comment
Share on other sites



×
×
  • Create New...

Important Information

Terms of Use