A combination of commit records and refresh window should enable changes made to data in one window to appear in the other. Commit records in the window where the data was changed and, if needed, refresh the window where it wasn't.
So with a 'commit/refresh' step I should get the Window showing a different layout to synch with the main layout when the ID of their records is based on the same table?
That's what I'd thought, but it doesn't synch. I've tried creating a new layout based on the Patient table, literally with just the Patient name on, but it doesn't synch with the main layout even when running a commit/refresh script.
Assuming that tutorial and patient are the same table:
Go to layout tutorial
It already has a go to layout Tutorial. Sadly, no improvement.
Is the tutorial layout and the patient layout in the same table?
Yes, the 'Patient' table.
What happens if you create the child portal on your patient form? Duplicate this form and add the desired portals.
One fact to consider:
1) if you make your relationship Parent::parentid<->Child::parentid<-->Grandchild::parentid you can create a granchild portal on the parent form.
2) if you make your grandchild relation Child:childId<->Grandchild::childid you will not see grandchildren records in the parent layout.
3) to see all of the grandchild records in one portal create a new relationshipand portal: Parent::parentid <-> Grandchild::parentid. You will have to insert that id using a script or calc.
It would help to describe this in more detail.
In general, if the context is the same for both windows, even if the layout is different, data changes in one window should be easy to show in both windows.
"Context" is determined by the table occurrences specified in Layout Setup in "show records from" and is further determined by what record on that layout is "current". If the same record, same table occurrence is there for both windows, the data changes should be simple to keep in synch.
Can I just check Phil what you mean by "and is further determined by what record on that layout is "current"? On the main Patient layout the context is determined by the Patient < Child < Grandchild. I'd assumed the Tutorial layout would, by being based on the same Table and TO, have it's context set by whatever was set on the Patient layout.
The found sets, current records and sort orders in one window will be independent of what you have in another window.
If you perform a find, sort records or change to a different record in one window, this change will not automatically take place in any other windows.
Right, that's what I wasn't 'seeing wood for trees' about.
So is there no way of synchronising Windows? I'll have to stick with having a Tutorial Popover or Tab on the main Patient layout rather than a separate (and easier to use) Window?
Yes, but it depends on what you are doing in each window and how you are doing it.
If you use a script to sort window 1, have the script do the same sort on window 2. If you find records on one window, do it via script and you can do it again in the other window, and so forth...
But you may find that it works better to rethink what you are doing such that you can make this happen without having two windows to keep in synch. Best to consider all options carefully.
Of course not.
You can perform a script to open a new window, pass the parent record id, find that using your tutorial layout.
Your basic problem is being tied to one particular approach when there are many ways to solve your question. We all constantly enter this state of consciousmess.
Oh, keep in mind your concept of 'synchronizing' the two windows which in and of itself implies that you will need to do some extra work.
It could be as simple as having a script open a new window named x.
your sync button action in window B
perform script sync parameter record id
set var $param get(scriptparameter)
Select window x
if get last error not 0
new window x (a floating window would be nice)
perform find field id = $param
select Window B
Click a button in window B to go to next record and that records id is passed to window x, etc.