Jump to content

The Application/Data model via Data Separation


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

Recommended Posts

I would like to create and distribute a "separated" runtime solution which acts like an "application" in enabling the user to manage multiple independent data sets with the same logic. Each independent data set would start as a clone of the Data Source listed for the data file side of the separation model, and the logic file would be directed to link to the appropriate data set upon opening, so the user would need to quit the "application" and reopen it to work with a different data set.

Ultimately I would like to keep a list of recent data files the user has accessed with this Filemaker "application," and make it simple for the user to open

- any of those recent files,

- another existing data file, or

- create a new data file (clone) and start using it.

I have gotten close to the minimal functionality by setting the Data Source to "Data File.fp7" then renaming "Data File.fp7" so that the "application" must go looking for the missing Data Source.

Filemaker handles this missing Data Source by displaying the error message "[Data File] could not be opened (not found)" then, once this error message is dismissed, sending the user to locate the missing Data Source file. All this happens before any scripts are processed, regardless of whether any references to the Data Source are on the current layout.

This error message is OK for me personally, but not satisfying in a distributed solution.

I started this evening thinking I could avoid the error message by simply using a variable or a global field in the Data Source definition. But from what I have been able to discover, at least as of v10, variables (and fields) are not allowed in data sources. And I have seen no mention that this has changed in v11.

In reading through every relevant post I could find in this forum (and finding many helpful tips in other areas), I did discover the Script command through which the user can be enabled to "Manage Data Sources" themselves, but this has two problems for me:

- I can't execute this step before the "application" has noted its need for the missing Data Source, presented the error message, and sent the user looking for the missing Data Source, and

- it seems to me too risky and confusing to give the end user the power to edit Data Sources.

Am I dreaming to think there is a programmable way within Filemaker to change the Data Source definition for external Table Objects?

Has anyone come up with a better method for what I am trying to do?

Thanks in advance!

Link to comment
Share on other sites

James, thank you for your reply. I was beginning to fear that the Data Separation forum was dead.

I have found what I am trying to do quite useful just on a single computer, as I continue refining an "accounting program" which I use to manipulate a variety of independent data sets.

I have also found I can use the same technique to provide my daughters a compiled program that accesses their financial data through an alias to a file on a central "server" (a 400MHz iMac), which I can then also access from my Filemaker when they aren't accessing it.

In their case, since they each only access one file, I name the alias according to what their compiled client is looking for. Since I want to pick which of their files I am going to open, I both aliases on my machine with neither one matching my "Apps" expectations, and endure the "file not found" message so that I can then pick which alias I want to open.

Does this help you understand my problem?

I doubt there is an answer available, but I figure it can't hurt to ask. Thanks again for at least trying to understand.

Link to comment
Share on other sites

2 runtimes? 1 datafile?

Interesting idea...

Not sure you will get it working the way you are doing it now... Maybe if you used os scripting to save a copy of the data file to the server after the runtime is closed and download it to the runtime folder before you open... that could work.

Link to comment
Share on other sites

Aholtzapfel, thanks for your interest.

What I have is working: a runtime file and a Filemaker file alternately accessing the same runtime datafile, which is stored on a central "server." The access of both the runtime and Filemaker file is through respective aliases to the runtime datafile.

My original problem, which I think I solved last night in my sleep, is how a Filemaker "app" can select from multiple alternate "data sources" without hitting the "File not found" message before it allows the user to identify the desired "Data Source."

I think the solution is to let the user identify the "Data Source" before opening the "app" with an additional Filemaker layer (file) which guides the user through the selection of the desired datafile (tracking previous choices to offer a history to select from), and then using Applescript to create an appropriately named and placed alias for the "app" to use to identify the data source.

Here is where I would need guidance:

- The user opens the "app opener" file, which guides the user in selecting a file to be the "Data Source." (This I can do.)

- The "app opener" then creates an alias to the selected file, gives it the name that the "app" is expecting, and places it in the location the "app" is expecting to find its "Data Source." (This is where I would need help.)

Unless someone helps me here with the creation of an alias from within Filemaker for another Filemaker file, I will look for a more appropriate forum for help with creating an alias from within Filemaker.

Thanks, all!

Link to comment
Share on other sites

  • 3 months later...

Robby

Did you ever find a solution to your dilemma?

You and I must be the only ones interested in developing accounting applications that require a separate data file for each client. At least, I think this is what you are after.

I'm new to Filemaker and just beginning the journey of learning the program; however, I've been using Visual Foxpro and (recently) Realbasic to accomplish this sort of scenario. My interest in Filemaker is that developing with Visual Foxpro is a dead-end since Microsoft has announced an end to support for VFP in 2014. And Realbasic will do what I want, but takes as long to develop an application as VFP does, which means years instead of months. My applications are distributable desktop applications and in 99.9999% of the time they are in a different state so I can't run over and install or update.

I was wondering if it would be possible to create a Filemaker application that would serve as a controller for a master database file. When the user wanted to create a new client, then the master database would be cloned (under a different name) and then the cloned database would be used to process that client's data. When finished, they would either quit the app or go back to the controller to create another file.

My question is, can Filemaker be programmed to do this using it's limited "file i/o" scripting capabilities?

Look forward to your reply.

Link to comment
Share on other sites

I got as far as "proof of concept" using AppleScript to manage aliases, then had to turn my attention to other things and haven't gotten back to it.

As I recall:

- Separate your Data from your Program

- Store the Data file in a global container field in your program as a source for new files

- Change the name of your Data

- Create an alias to your real Data under the old Data name

- Export new copies of the Data as necessary

- Shuffle aliases using AppleScript to have your "Program" open the right Data

- Perhaps use a helper FM file to close your "Program" and open it again with a different Data file after the aliases have been shuffled using AppleScript.

I assume something similar to AppleScript is available in Windows, but I have no experience with that.

As I say, I haven't gotten back to this project to test it in production, and it appears a bit "rickety" as I describe it here, but I think it may work well enough for my purposes.

Let me know if you have luck with this, or questions, etc.

Link to comment
Share on other sites

What about developing your own file format in XML to hold all of a user's data set?

1. User starts up the FileMaker runtime. The most recent data set is present. (If empty, a script walks user through naming and creating a data set.)

2. User works with the current data set.

3. User exits the FileMaker runtime with the termination script configured to export a fresh copy of the current data set to that set's designated XML file.

4. User starts up the FileMaker runtime.

5. User chooses to switch to an alternate dataset.

6. If necessary, save a fresh copy of current data set before importing alternate data set from an XML file.

7. The alternate set is now the current data set.

Link to comment
Share on other sites

theTominator,

You wrote:

What about developing your own file format in XML to hold all of a user's data set?

Thanks for suggesting this alternative. I have not delved far enough into XML to consider it, but may check this out.

Edited by Guest
Link to comment
Share on other sites

Vaughn,

You wrote:

All this to save a spending couple hundred dollars for the FMP full client?

I'm in the penny pinching world of faith-based non-profits, and am wanting to produce compiled solutions from a simple Pro Advanced that can be given away to thousands of people and organizations that would never spring for the cost of a client.

However even where the end user will pay for their own copy of Filemaker, there may be some benefit to enabling Filemaker to act more like an "application" which can work transparently on multiple independent data sets.

Link to comment
Share on other sites

I'm in the penny pinching world of faith-based non-profits, and am wanting to produce compiled solutions from a simple Pro Advanced that can be given away to thousands of people and organizations that would never spring for the cost of a client.

So look into a web-based application.

Link to comment
Share on other sites

Vaughan,

I wrote:

I'm in the penny pinching world of faith-based non-profits, and am wanting to produce compiled solutions from a simple Pro Advanced that can be given away to thousands of people and organizations that would never spring for the cost of a client.

You suggested:

So look into a web-based application.

I appreciate your willingness to push back on my assumptions and offer alternatives.

I perceive several barriers to a web-based application:

- Many of those I want to assist are scattered in locations where internet access is still non-existent, and for all practical purposes may continue to be indefinitely.

- The range of accounting novelties which I want to make available have not, to my knowledge, appeared in any inexpensive version of accounting that I know of.

- I have decades of experience in Filemaker from when I was a full time programmer, and have developed in Filemaker several generations of the accounting software I am working to update.

- I am not aware of another programming platform that would be worth the effort for me to learn for this project. Is there one you would suggest?

Thank you in advance for any alternatives you have to suggest.

Edited by Guest
Link to comment
Share on other sites

Vaughan,

My accounting implementation involves a complex grid for each financial "entity," which tags each of potentially thousands of transactions per year by: year, cost center, bank account, period, entry, and account, with summaries available across multiple matrices of time and account.

To avoid bogging down with Filemaker's automated summaries, I have taken to maintaining summaries manually with event triggers, which adds to the overhead complexity.

All of this seems complex enough without the additional complexity of handling the isolation of multiple, unrelated data sets such as personal vs. corporate in a distributed free solution that I hope will potentially serve thousands of individuals in hundreds of organizations.

Since I can see no potential benefit to combining multiple unrelated organizations into the same set of data, it seems to me the better approach is finding a way for Filemaker to emulate the "application/data" model which most programs maintain and with which most computer users are familiar.

Given the limited availability of internet for many of those I want to serve, and my underlying resistance to combining the data anyway for the reasons mentioned above, I am not seeing how a web application such as you suggest would help.

However I am intrigued by a prior post's suggestion of using "record level access privileges." Since I only jumped from FM4 to 9 and 10 a couple years ago, I have not really experimented enough to become conversant in the use of privileges. Do you see some relevance in that to what I am describing?

Am I missing something else about your suggestion of a web application?

Thanks again!

Link to comment
Share on other sites

Going back to the original post for a moment:

I would like to create and distribute a "separated" runtime solution which acts like an "application" in enabling the user to manage multiple independent data sets with the same logic. Each independent data set would start as a clone of the Data Source listed for the data file side of the separation model, and the logic file would be directed to link to the appropriate data set upon opening, so the user would need to quit the "application" and reopen it to work with a different data set.

Why not just create separate run-times for each "data set" since the run-time is free. Users then choose the data sets by selecting which runtime to open. They could even have multiple open at once should they desire.

IMHO you're being sucked into the vortex of complexity-death.

Link to comment
Share on other sites

Vaughan,

You wrote:

Why not just create separate run-times for each "data set" since the run-time is free. Users then choose the data sets by selecting which runtime to open. They could even have multiple open at once should they desire.

IMHO you're being sucked into the vortex of complexity-death.

Thank you for this insightful observation.

At present my Filemaker involvement is as a hobbyist who has the luxury of exploring possibilities rather than a professional who has to produce results, even though I hope eventually to produce something useful.

So the question of whether a single Filemaker solution can be made to act like an application is like a mountain that beckons me to climb it, regardless of the impracticality.

As I tinker to refine my basic accounting solution through real accounting work with multiple independent sets, I find data-separation a wonderful improvement over my FM4 days, when the code had to be in the same file as the data. Filemaker's default to ask me each time for the location of a renamed data source is quite adequate for my programming context.

Once the underlying data structure is finalized, keeping the data separated from the code will also be much handier for updating distributed solutions than if the data were embedded in the same file with the code.

But your comment helped me realize that my distributed solutions don't need to share data sets between one set of code since my "users" presumably won't be refining the code like I am. Every other instance of whatever I distribute can have as many program files as they have data sets.

So I don't need a more robust approach than I presently have.

Still, as an exercise, I am interested to see how far I can go toward coaxing Filemaker to act as an application to deal with multiple data sets. And perhaps someone will someday find a real use for this exercise.

Link to comment
Share on other sites

  • 4 years later...
  • Newbies

Robby,

 

I know this discussion is like 4 years old, but are you still out there? Did you ever solve it? I am trying to do the same exact thing (in FMP13 Advanced) and running into the same lack of good discussion about it online. It seems like such an appealing prospect to allow the user to swap out data files within the same UI file. My users are pretty highly-skilled, so I'm not opposed to allowing them to just manage external data sources cuz that method works great, but I can't even seem to figure out how to give them permissions to do that if they're not in the [Full Access] privilege set.

 

I also thought of trying to use aliases on my mac, and I've been playing around with it with mixed results. I'm usually able to get the UI file to load an alias of a data file, but when I start actually making changes in the data, they're somehow not being written to my actual data file. When I open the data file via the Filemaker Window>Show menu, I somehow get a data file with the name of my alias and the correct data. But when I manually open the real data file (the source of the alias) from finder, it does not have the same data. I don't even understand how this is possible or where Filemaker is actually writing that data to. It can't be the 477KB alias, can it?

 

So any other ideas? Did you ever come up with a stable, reliable solution?

Link to comment
Share on other sites

You could create a utility/launcher file that would allow you to choose which data file you wanted, and then it could rename it to "current data file" (or whatever), and optionally launch the main interface.

 

All the interface file cares about is the name of the data file (including the path), thus my suggestion.

 

All fairly straightforward with a plugin such as Troi File or BaseElements.

 

PS: Please start a new thread next time. You can put a link in it to the old thread.

Link to comment
Share on other sites

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