Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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

Recommended Posts

Posted

I have a file that contains data on all employees and volunteers. I have a second file that is related through the field "ID No." (this number is established each time a new record is created in file number one). What I need is a script in file number one that will copy the ID No. and then open file number two and paste the ID No. into a new record there. Can anyone tell mne how to do this?

Thanks,

confused.gif

Posted

Avoid Copy/Paste.

Use a global and a constant relationship from a File 1 to File 2.

In file A, create a field called gHook, set to be a global number field.Define this field to be =1

In the second file, create a field called cHook (stored calculation = 1).

Create a relationship from File 1 to File 2 (call it Constant)

Create a global field called g_ID (same format that your ID) in File 1

Then the script in File 1 should be.

Browse Mode

Set field g_ID (=IDN

  • 6 months later...
Posted

Hi, I have same problem. Just want to get several things clear.

1. The constant relationship will be defined in 1st file, right? with gHook on the left and cHook on the right?

Then How can you using this relationship in the 2nd file when you define the "Set ID" script?

2. I want put a button in 1st file to trigger the script. but what if the user click the button by mistake? then there will be an empty record(only has ID #) in 2nd file, right?

I must miss something here. What's the trick?

Thank in advance!

Posted

I think Ugo is on holiday so I'll try to answer this one...

>>1. The constant relationship will be defined in 1st file, right? with gHook on the left and cHook on the right?

>>Then How can you using this relationship in the 2nd file when you define the "Set ID" script?

Actually the relation does not have to be valid if you only want to use a global field from another file.

So you can just define a relation from file 2 to file 1 using gHook and cHook, or define g_ID in file 2 in stead of file 1

The second problem could be tackled by starting the script in file 1 with

Show message "Are you sure you want to create a new record?"

If Status(CurrentMessageChoice = 2)

exit script

end if

Hope this helps.

Ernst.

Posted

Thanks very much, Ernst. and sorry for my late reply.

So there is no other more controlable way to handle the 2nd problem? I don't want use portal b/c the user doesn't like the whole screen blackout.

Posted

Presumably you will want more data in the related file than just the ID - otherwise there's not much point in having the record.

I use a tachniwue to validate by script all the required fields. Try this and if the user cancels the routine then delete the record just created before you return to the main script in the master file.

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