Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

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

Recommended Posts

Posted

I CREATED 2 TABLES WITH 4 FIELDS IN EACH

TABLE-1-----F1,F2,F3,F4

TABLE-2-----2F1,2F2,2F3,2F4

I MADE RELATIONSHIP BETWEEN 2 TABLES AND WHEN I ENTER INTO TABLE-2 F1 CONTENT OF THE LAST RECORD SHOULD AUTOMATICALLY BE ENTERED INTO 2F1 HOW TO DO IT I TRIED ALOT BUT IN

VAIN , PLZ SOME ONE HELP ME

Posted

It might help if we knew what the purpose of this is, and real table and field names - I find it very difficult to understand what F1, 2F1, ... are.

Why do you need to duplicate data from one table in another?

Posted

I MADE ABOUT 49MB DATABASE IT HAS MULTIPLE RELATIONSHIPS I WANT TO KNOW HOW SCRIPT FIELDS SO THAT THE SAME FIELD CONTENT BE AUTOMATICALLY BE IT IN THE OTHER FEILD WHICH IS PRESENT IN OTHER TABLE I MADE PERFECT RELATIONSHIP BETWEEN 2 TABLES I JUST WANT THE FIELD CONTENT BE AUTOMATICALLY BE IN THE OTHER FIELD OF OTHER TABLE

Posted

Hello Dr. gkr :^)

Please do not type in all caps ... it makes it nearly impossible to read and it is considered rude in the cyber world.

You were asked specific questions about your table names and real purpose. If you cannot answer the questions then we cannot assist you properly, which is the only reason the questions were asked. If English is not your native language, we will be patient while you try to explain and you can even type in another language and we can probably translate fairly accurately. :)

Posted

wow laretta i got you again last year you solved my problem.

i made 2 tables

table1---- wide screen view

table2--- A4 print sheet.

in table1 i made about 45 fields

in table2 i made about 36fields

in table1 i made filed called unique-id

in table2 i made field called op-id

i made all necessary relationship working perfectly.

after entering all data in table1 i will jump to table2 to enter op-id which must be equal to unique-id in table1 and instantly the current record has to print from table2

layout and come back to table1 new record .

all this problem is i dont want to go to table2 and manually enter op-id in table2 i want it to be done in blink of eye

i just want to know how auto enter op-id in table2 which must be equal to table unique-id .

Posted

Here is a script which will create a record in your A4 print sheet table (table2) and insert the unique ID from Wide Screen (table1) into op-ID field in your child table (A4 print sheet). Script should be attached to a button on your Wide Screen layout, similar to:

Set Variable [ $opID ; unique-ID ]

Freeze Window

Go To Layout [ layout based upon A4 print sheet ]

New Record/Request

Set Field [ A4 print sheet::op-ID ; $opID ]

Commit Record/Request

Go To Layout [ original layout ]

... at this point, I assume you have an A4 portal on your Wide View layout so you can view the A4 records. Your new record should appear in the bottom (if unsorted).

If I've missed the mark, let us know and we can help further.

Posted

Type in Name: $opID

Type in Value: click Specify and find your Widescreen OP ID field and double-click to insert it, then say OK

Then after you create the new record, the next Set Field[] will reverse it by setting your OP ID field in A4 with $opID. Be sure to type it exactly as you entered it in Name because you won't get a warning if it is wrong, it just won't work.

Posted

There are two parts to a Set Field[] ... 1) the field to be set (you click in the first Specify, 'specify target field' and select your field which you have already done and 2) Specifying the 'calculated result' in the next section. This is what you are missing. Click this second Specify and type only

$OP ID

... then say ok and exit.

Posted

Are you are starting on a layout based upon OP PATIENTS MAIN? Look at (from layout mode) Layouts > Layout Setup and 'Show Records From.' You have FMP Advance so you can walk it through debugger and see what it shows - it will display errors at the bottom. Otherwise, we will need to see your file.

If you are not in a position to create an empty clone ( File > Save Copy As ), zip and attach here then you can also contact me in private message and I will take a look off line.

By the way, I neglected to ask, LOL, how did it fail? Did it create the new OP PATIENTS PRINT record at all? Did it insert the wrong ID or no ID? Did it fail to return?

Posted

i did as you said but failed

3.png

do you have a valid relationship? pK_ --> pK_foreign

can't you debug? open a debug window and step through the script to see where it fails!

-i

Posted

relationships are working perfectly i just want the op id to be filled up with the last record of OP MAIN::OP ID to OP PATIENTS PRINT::OP ID

Your script looks right but what does this mean ... The 'last' record? It will fill up the OP PATIENTS PRINT OP ID with the ID of the main record you are on when you fire the script. I do not even know if this is two table occurrences of the same table or different tables alltogether. Why are you wanting to grab the last Main record's OP ID with your script when you aren't on the last record?

You are leaving me working blind because you haven't answered my questions. So my only way forward is to ask more questions. If you want to create the related record with the last record in your main table then you must issue a: Go To Record/Request/Page [ Last ] but that would be based upon the found set. So to get the last record in your main table, you can use the Last() function or relationship but I still do not know how you are related (remember my questions?) and so I cannot advise. We need to know what you mean by last ... is it the last record created? Or is it based upon a different date? Is your relationship sorted?

Not enough information and lots of questions. Save us both some time reading and responding by providing more details about your setup please or the file otherwise this will wear me out. :sweat:

Posted

Dr. G, I am afraid I am going to let you down.

You have two identical tables with the same fields in each and you do not need them. You can just pass the ID and then place the fields from your main table on your print layout. But I still do not know what you are trying to accomplish by using that secondary table. Do you want to print a Patient record and then create a record of when it was printed (including the print date)?

Anyway, I can give you a script but it will be identical to the one I already gave you and identical to the one you have already shown you've created. I don't know what else to do at this point. Maybe others can spot something I'm missing and step in. I wish you the best with it, sir.

Posted

Well then I guess you wouldnt mind paying for her time. :hyper:

Posted

Dr. G, I am afraid I am going to let you down.

You have two identical tables with the same fields in each and you do not need them. You can just pass the ID and then place the fields from your main table on your print layout. But I still do not know what you are trying to accomplish by using that secondary table. Do you want to print a Patient record and then create a record of when it was printed (including the print date)?

Anyway, I can give you a script but it will be identical to the one I already gave you and identical to the one you have already shown you've created. I don't know what else to do at this point. Maybe others can spot something I'm missing and step in. I wish you the best with it, sir.

iam trying to accomplish widescreen layout for my easy user face interface and other is for perfect A4 print as in the above example not set to A4

Posted

iam trying to accomplish widescreen layout for my easy user face interface and other is for perfect A4 print as in the above example not set to A4

You don't need another table just because you want a different layout. You create the second A4 layout in your main file, if I understand correctly. :^)

Posted

Do you not have an auto-enter serial number in your table? Create number field called OP_ID and in Options > Auto-Enter tab, specify serial number. Then, if you have existing data, show all records, place your cursor in the OP_ID field and run in Browse mode > Records > Replace Field Contents and 'replace with serial number'. Set it to start with 1 and increment with 1 and be sure the checkbox is checked 'update serial number' in field options.

By golly, I think we might be moving forward again!

I have the feeling you are rolling ahead at full steam with no concept of relational theory (a few other posts suggest problems in your file as well). It has nothing to do with intelligence nor capability - it has to do with training (something I am sure you understand). It would be very beneficial if you had your structure evaluated to be sure you are staying on track. The biggest mistake I see in this business is folks building improper structure and then they have to ditch it and start again because they have created a box canyon.

Take the time (and spend money if necessary) to have your structure reviewed. This goes for everyone and yes, when the least bit unsure, I have my structure reviewed as well. You will also work ten times faster (actually more like 50 times faster) with good structure.

Posted

You have a basic misunderstanding of tables and layouts. From your first post, I wondered if you felt that each layout required a dedicated table. It looks as if that is the case. Hate to say it, but please do the tutorial and take apart some of the templates.

LaRetta showed you much patience.

Posted

i am having perfect idea about layout tables relationships what are they how they work you didnt understand what i am trying to say its not about layouts or tables i want a jump of data from one table to other i will provide another .fp7 with scripted and hope you all will understand what m saying .

laretta patiently read and answered may be my question is wrong or you didn't understand but i know what i want and i am 100% sure fmforums will give answer now its 2200hrs time to sleep be back with new .fp7 thanks everyone your little trick will save 100s of hours time in my lifetime. :thankyou2:

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