
NCB
Members-
Posts
23 -
Joined
-
Last visited
Everything posted by NCB
-
Actually, I just found another way to accomplish this. I export the data with "Export Records," create the header in a variable $header, open the exported file with Scriptmaster, then write the header and the exported data back into that file. It's a roundabout way to do it, but it works!
-
Oh, that is a good idea. How do you get the "Export Records" step to append? I imagine that you first export your custom header to the file using "Export Field Contents", then export the records to the same file with "Export Records?" I imagine one could create a temporary table to populate, then just export that, but I'd like to stay away from creating new tables, if possible.
-
I have several tables which I want to export to a TSV, but I wish to include a custom header at the top of the actual exported data. This custom header is comprised of the field comment of each field, NOT the field names themselves. Currently in my export script, I am adding the custom header row to the actual data, sorting it to the top, exporting, then deleting it. However, there seems to be a problem when users run the exporter concurrently, and actual data rows are being deleted occasionally instead of the headers. Because I can't figure out how this is happening, I want to eliminate the need to delete records at all in the export script. My new idea is to generate the custom header inside a global variable, use the standard "Export Records" script step, then somehow tack the two together inside filemaker, perhaps with ScriptMaster. There is a problem with the ordering of the columns, as that is determined by the export order when "Export Records" is run, but I am filling a value list with my standard export order and generating the header based on that. I could just concatenate all the rows into a variable and write that to a file as well, but that is much too slow. Any ideas on how I can accomplish this? Is there a faster and/or simpler way to do this than my proposed method?
-
I implemented your solution, Fitch, and it works well for most tables, but I came across another problem. Â I have a few tables that are not directly connected to the ExtraData table -- they are connected to it via another relationship. (See attachment ). ExtraData's key, IntermediateTable's key, and the Tables' key are the same. Note that both ExtraData and IntermediateTable's key field are set to "Auto-enter serial, Unique, Allow Overrride." Â On the tables that have this arrangement, I get an error that says: "key defined to require a value, but it is not available on this layout. Use another layout to assign a value to this field" when creating a new record (which then attempts to create a new ExtraData record). Â I think that because the keys on each table have validators, the error is being thrown when IntermediateTable's key is trying to override ExtraData's key. Is this correct? Is there a way to fix this? I removed the "Unique" validation on IntermediateTable, and everything seems to work now, but I need to keep the "unique" validation for other reasons.
-
Thanks, I'll give that a try.
-
Awesome, that works! While it is a hassle to have to save the original location in several variables, this is a much better solution than anything I have tried. Thanks!
- 2 replies
-
- flashing window
- foreground
-
(and 2 more)
Tagged with:
-
This seems like something that should be possible, but every time I try it, it does not work. I have a script that goes to each layout in my database. When doing so, it flashes and looks really ugly, so I want to 'hide' this window in the background while the script works on it, and create a new window with a "working" layout that remains in the foreground. Unfortunately, whenever I make a new worker window and "Select" it to bring it to the foreground, the script starts executing on the worker window. The script needs to only work on the original window, while the worker window is in the foreground. I have also tried using "Freeze Window" on my main script to get rid of the flashing, but the script has "find" steps that seem to refresh the window. Is there a way to hide or "background" the window on which the script is running?
- 2 replies
-
- flashing window
- foreground
-
(and 2 more)
Tagged with:
-
This has been stumping me for a long time, and I am sure I am overlooking something incredibly simple. Hopefully I can explain this well enough.  I have a relationship between several tables (see example ).  Whenever a record is created in any of the three related tables (Table1, Table2, Table3), I want a new ExtraData record to be created with the same key as the record in the related table. I also want the userValue to be set to the value of a global variable I have $$curUserValue, only if the ExtraData::userValue is empty. If the ExtraData record exists, the ExtraData::userValue changes, AND the key changes, the ExtraData::userValue should just be updated.  Right now I have an onRecordCommit script on the three tables' layouts that creates a new ExtraData record with the current record's key, if such a record does not already exist. It also sets ExtraData::userValue = $$curUserValue. This works fine, but if the related table record's key changes, then a new ExtraData record is created with the new key and $$curUserValue. The problem here is if the ExtraData::userValue field has changed, along with the key, it gets overwritten with the original $$curUserValue.* I want to keep it the same as what it was before the key change.  There must be a much easier way to accomplish this, but the solutions escapes me. Any ideas?   *I am NOT concerned with the orphan records this creates, as I have a script to clean those up.
-
Oh, I did not know about that script step. Thanks for pointing that out!
- 2 replies
-
- scriptmaster
- raw data
-
(and 1 more)
Tagged with:
-
Currently I have a script that downloads images from a web location using the Troi URL plugin (The TURL_Get function). I want to replace the Troi function with a ScriptMaster function. Is there an existing one that will allow me to get raw data from a URL? Thanks!
- 2 replies
-
- scriptmaster
- raw data
-
(and 1 more)
Tagged with:
-
Auto-fill data in related table when a record is created
NCB replied to NCB's topic in Relationships
Oh, duh. I am sorry, I was in a hurry yesterday and accidently clicked open the compressed folder to the file. DX Thank you, mr_vodka, that script worked! While it does only work after a commit, and I'd prefer it to run as soon as a record is created, it should still be fine. Thanks! -
Auto-fill data in related table when a record is created
NCB replied to NCB's topic in Relationships
No, I couldn't see the script because the file was read-only and I couldn't look in the script manager. Could you type the script out here? I think I understand what I need to do, but I can't figure out how to check if a matching related record exists. Also, if I modify a field in the related table with a key that does not yet exist, will that create a record with that key? -
Auto-fill data in related table when a record is created
NCB replied to NCB's topic in Relationships
But how would this script you reference be called? I want it to only happen when a record is created, and there is no "OnRecordCreate" script trigger. -
Auto-fill data in related table when a record is created
NCB replied to NCB's topic in Relationships
I am just entering data, not a calculation. Right now, as a test, I am just auto-filling with "1" -
I have a table (table1) that is related to another table (table2) by its key. When a record is created in table1, a new record is created in table2. This is defined by their relationship. I want the new record in table2 to have some checkbox fields auto-populated.I have tried using the auto-fill option for the specified fields in the related table, but it is not working. The only thing that seems to work is a script with some "Set Field" calls to those fields, but I have only found an "onRecordCommit" script trigger to run this, and I need to to run as soon as the record is created. Is there a better way to do this? Thanks.
-
Matching records with empty fields OR matching fields
NCB replied to NCB's topic in Finding & Searching
Thanks for the suggestions. I looked at the Length(Category) in the data viewer, and it is still showing 0 for the ones that it does not find. What else could be going wrong? EDIT: Hmm, I did manage to find a solution to the overall problem, though I am still not sure what was going on with it not finding empty fields. -
There is probably a simple solution for this, but I can't seem to find it. I have a field called "category" and a field called "editing." I want to find all records that: Do not have a value in the "editing" field. (The "editing" field is empty/null) Do not have a value in the "category field OR the category field matches a variable $curCategory In a script, I am calling a "Perform find" to do this. Right now I am using an "Omit records" with "editing = *", and am trying to figure out how to code the rest of the logic. I know that one can use just "=" to find empty records, but for some reason, this is not finding all the records that have no values. With any other programming language, I could use something like: if(editing==null && category == null || category==$curCategory) How do I do this in Filemaker? Thanks.
-
It is possible if you use a script to create new windows. There is a "New Window" script step that allows one to enter a name for the window. If plaintext or certain variables are used in the file name and the script is run more than once, you can have windows with the same name. This must just be something that was overlooked, as it is not relevant in most contexts. Unfortunately, my problem requires unique window names. I did find a workaround, albeit a messy one.
-
Well, I guess it just seems odd that these unique objects do not have unique identifiers. But I guess it only cares about a window that is selected. Interestingly, there is a Select Window[name] script command. When names are not unique, this script step just seems to select the topmost window with the matching name. So maybe Filemaker doesn't care about unique names at all? That just seems odd.
-
Creating windows with the same names is not a fluke; when a user opens the same table (say, "Table1") on the same record (say, "Record_0001") in a new window twice, I get two "Table1 : Record_0001" windows. I'd like to name the windows to describe the window content, so some might be the same. My solution was to just tack on a Get(UUID) to the end of the name, so the name is unique, but still descriptive to the user. It's not the cleanest solution, but it works. I was just hoping I could somehow "hide" the ugly UUID from the user so it wouldn't become confusing. If that's not possible, that's okay. I tried giving the window a List as a name, including the table and record name as one element, then the UUID as the second. Unfortunately, the UUID still shows up on the window title. I am wondering, though, how filemaker itself differentiates windows with the same name? There must be some sort of unique window id somewhere.
-
I have several scripts that open certain database tables in a new window for users. I name these windows "$TableName" & ":" & "$RecordName" for usability. Unfortunately, I have another script that relies on the fact that each window has a unique name, but this is obviously not the case. Is there any way I can get a unique ID or something for the window, rather than referring to it by its name? I know there is a Get (WindowName), but is there something equivalent to what a Get(WindowID) function would do? Is there a way I can use Get (UUID) here? Let me know if more information is required. Thanks.
-
Thank you for the link, but I would want to use LDAP, which it doesn't seem is supported by external authentication. Is there any other way to eliminate the need for each user to log in each time?
-
On FM for Mac, there is an option to "remember password on keychain", allowing users to essentially be loggen in automatically when they open the database. I want to be able to have this same functionality on FM for Windows. Is this possible? I know that there is a File --> File Options --> "Log in using:" option, but this is a global change; ALL users will sign in with this default account, and I want each user to be able to log in with their individual account without typing in credentials on their computer. Is this possible? Also, the database in use is local to a network. Can we use our network credentials to automatically log in to the database? Thanks!