I have a main form called fm_Main. This fm_Main contains an embedded view which has 2 actions: Add & Delete. When I click Add is opening another form called fm_Second and here I can add some fields which will be displayed on the embedded_view on fm_Main.
The problem is: Let say I have 3 documents. All of them contains an empty embedded view. If I add some value fields in one document into the embedded view and then I save that document, all the 3 documents contains that values into the embedded. It should be: just one of them should cotain because I modified only one, the 2 of them shoudn't have that values displayed in the embedded view. Thank you!
PS: Also if I saved one document with an entry into the embedded view. When I want to create another new document, in the embedded view there exists the last entry from the last document. I want to be empty!
You must filter the embedded view to only show the entries related to the currently open main document.
Most programmers would use the UniversalID of the main document, it can be automatically populated into the entries you create.
One thing to think about is that you may want to store the Universal ID in a computed when composed field on teh main document. If you get a replication error in the future, the Universal ID may change, and you will not be able to get to the entries in the embedded view.
I been doing exactly this in several large Notes databases, works perfectly fine.
Expanding on Karl-Henry's suggestion, you should make into a categorized view and use the Show Single Category feature of the embedded view. I might suggest using the #Unique function instead of the UNID to relate the Main and Second documents, but that's a matter of preference. In either case, you have to make sure that the value inherits down into a field in the Second docs, and you can use that field as the category for the view.
Related
I am trying to create a form, in which the person fills in a title and other info in the first page, and I would like to have this info update in the whole document's headers, so each section wouldn't have to be manually updated.
I created legacy text form fields and a drop-down list, so I could bind them to bookmarks, which I wanted to reference.
When I put the references in the body of the next sections, they do update once I tab out of the fields, but the header remains empty with the same references.
Any tips on how to approach the problem?
I did try with creating unique styles for these items and referencing that, but it was also unsuccessful.
I also aim to have other parts of the form updating based on the drop-down list selection by using field codes. The first attempt is also working in the body of the document, so it's mainly the headers I am struggling with.
I'm new to Filemaker.
I want to create a database for my library.
Lets say we have a text field for the title of each book (book_title) and a container field for the cover photo (cover_photo).
I'd like to help me write a script that would allow me to copy the photo (that is, the content of "cover_photo") from one record to the other if the field "book_title" is identical within two records.
For example: lets say I have 5 copies of a book in my library. For the first copy I'll create a new record and I'll write the title in "book_title" field and I'll insert a photo in "cover_photo" field. But for the second/third/... copy I'd like to write only the title and, since it will match with the title of the first record, enter automatically the photo in the first "cover_photo" field without inserting it again.
I'd appreciate any help.
Thank you.
IMHO, it would be much better to use two tables, say Titles and Exemplars, with a one-to-many relationship between them. The cover photo would be stored in a field in Titles, and all the child exemplars could display it without you having to duplicate it.
This is assuming you have something unique to record about each exemplar - otherwise you could simply have a field for Quantity in the Titles table.
I'll keep this as clear as I can:
My database has two tables:
Clients
Contacts
They have a relationship: For each client (Which is a company, for your understanding) there can be any number of related contacts.
The database has three relevant forms:
SearchFrm
NavigationFrm
ContactsSubFrm
SearchFrm is a form that reads from the Clients table, and has a combo box that, according to chosen record (name), displays all it's other fields in their respective text boxes.
Inside SearchFrm, ContactsSubFrm appears as a datasheet subform, that displays all contacts related to the chosen record in the form, (using a query of Contacts.[Workplace ID])=[Forms]![SearchFrm]![ID]
NavigationFrm serves as a means of navigation between forms. For now, it's only for SearchFrm, but more will come.
And now, the problem: The query that ContactsSubFrm runs doesn't work inside NavigationFrm, when run, I get an input window for [Forms]![SearchFrm]![ID] every time it's suppose to run. This only happens inside navigation.
I'm pretty sure this is because the SearchFrm form itself is closed, and has a problem working through a navigation form, but I can't think of a solution.
Thank you very much.
I was looking for the answer to the same question, so I thought I'd put my solution here in case anyone else comes looking for it...
As stated above, you have to reference the field within your form within your navigation form in your query (as opposed to just the field within your originally created form.)
The best way to do this is:
Open your navigation form.
Open any other form.
Access the expression builder from the other form.
Find the field in your navigation form that you need to reference. Mine looked something like this:
Forms![NavigationForm]![NavigationSubform].Form![Field]
Copy and paste into your query
Since your form moved location (now inside a navigation form), You could try to modify your query from: [Forms]![SearchFrm]![ID] to: [Forms]![NavigationFrm]![SearchFrm]![ID]
I solved this by changing the reference in the query itself to
[forms]![frmNavigationForm]![NavigationSubform].[Form]![ID]
I have a main form which contain an embedded view. This embedded view is displaying field values that exist in another form. How can i display fields that are in the main form and fields that are in the other form on the same ordinary view?
Firstly, your View Selection formula needs to select documents created with both forms
SELECT Form = "Main" | Form = "Other"
or you can use a short-hand version
SELECT Form = "Main":"Other"
Then you need to enter a conditional formula in the column where you want to display values from documents created with both forms
#IF(Form = "Main" ; FieldName1 ; Form = "Other" ; FieldName2 ; "")
although, as only those two forms are permitted, you can shorten that too
#If(Form = "Main"; FieldName1 ; FieldName2)
Hope this helps,
Phil
You could emulate the view in a rich text field, using the technique I describe here:
http://www.bleedyellow.com/blogs/texasswede/entry/dynamictables
You need to modify the code to get both your "main" document and your "other" document, and combine them together into one row. This way you can display values from different documents (even one "main" and multiple "other" documents).
It would work something like this:
Create temp document with rich text field.
Get the first "main" document and "other" document(s) associated with it (doc.Responses if they are child documents).
Create a new document using the row template form, and put values into the different fields.
Render the new row document into the rich text field on the temp document.
Repeate above steps for each main document.
If you only have values from one other document displayed on the main form, there's no need to use an embedded view to display the values. You could use computed text to display the values from the second document along with values from the main document.
If you need to view multiple documents and want to include values from the main document in the embedded view on the same lines as the other documents, I would recommend having the values from the main document be stored on those other documents, rather than trying to put the other document data on the main form (since there would be multiple other documents, requiring multiple field values on the main).
That said, if the field values are already on the main form, why do you need to display them a second time on those lines in the embedded view? After all, it would repeat the same value on every line in that column.
Visualize it in sql format:
Form A:
EmpNum | Name
Form B:
Name | Project
Can I have something like this in Lotus Notes:
SELECT *
FROM Form A, Form B
WHERE Form A.Name = Form B.Name
I am trying to store metadata (basically a unique id) along with each cell of a table in a Word document. Currently, for the add-in I'm developing, I am querying the database, and building a table inside the Word document using the data that is retrieved.
I want to be able to save any of the user's edits to the document, and persist it back to the database. My initial thought was to store a unique id along with each cell in the table so that I would be able to tell which records to update. I would also like to store some sort of "isChanged" flag within each cell so that I could tell which cells were changed. I found that I could add the needed information into the "ID" property of the cell - however, that information was not retained if the user saved the document, closed it, and re-opened it. I then tried storing the data by adding a data to the "Fields" collection - but that did not work and threw a runtime error. Here is the code that I tried:
object t1 = Word.WdFieldType.wdFieldEmpty;
object val = "myValue: " + counter;
object preserveFormatting = true;
tbl.Cell(i, j).Range.Fields.Add(tbl.Cell(i, j).Range, ref t1, ref val, ref preserveFormatting);
This compiles fine, but throws this runtime error "This command is not available".
So, is this possible at all? Or am I headed in the wrong direction?
Thanks in advance.
Wound up using "ContentControls" to store the information I needed. I used the "Title" field to store the unique id, and the "tag" field to track whether the field had been changed or not. See this link for more info: http://blogs.technet.com/gray_knowlton/archive/2010/01/15/associating-data-with-content-controls.aspx
Since a "Word 2007 Document" is XML, you can add a namespace to the document then adore the elements with attributes from your namespace. Word should ignore your namespace when loading and saving. Moreover, you can add new elments to store any information (metadata) needed.
With that said, I have not used this technique with Word, but I have done it successfully using Excel 2003.
First thing to try, is create a bare "Word 2007 Document". In your case, add a simple two by two table. Open it with a text or XML editor and add your namespace, and adore an attribute and add an element. Open with Word make a change then save it. Open with editor and make sure your namespace attribute and element have not been changed.