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

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

Recommended Posts

Posted

Greetings;

I am trying to get a script to copy and paste information from Layout B Fields 1, Fields 2, Fields 3, Fields 4, Fields 5 and to paste them into Layout A Fields 1, Fields 2, Fields 3, Fields 4, Fields 5.

I read somewehere about SET Fields is better to use then Copy and Paste and even with that, it still isnt working. Here is a copy of the codng.

If [phone list::Outcome1 = "Appt"]

Goto Layout ["Booking Sheet"(Bookings)]

New Record/Request

Set Field [bookings::ApptStatus; Phone list::Outcome 1]

....

When i run the script i get the new record, but nothing is being copied over.

Posted (edited)

I am trying to get a script to copy and paste information from Layout B Fields 1, Fields 2, Fields 3, Fields 4, Fields 5 and to paste them into Layout A Fields 1, Fields 2, Fields 3, Fields 4, Fields 5.

You need to have a relationship between the two tables before you can grab data from the first table to use in the second. However, if you have a relationship then copying the data from those five fields to the second wouldn't even be necessary.

Do you have primary keys in both tables (unique auto-enter FM-generated serial numbers)?

Do you have the Bookings primary key as a foreign key in Phone List Outcome 1? You need a relationship:

Bookings::BookingID = Phone List Outcome 1::BookingID

Then you want to do is something like this (when on Bookings layout):)

Set Variable [ $bookingID ; Bookings::BookingID ]

Go to Layout [ layout based upon Phone List Outcome 1 ]

New Record/Request

Set Field [ BookingID ; $bookingID ]

Commit Records/Requests

Now that you have between the two tables, go to your Phone List Outcome 1 table and Insert > Field and select your field1 from Bookings and place it on your layout. Repeat with your other fields. * There is no need for duplicate data in both tables.

* Sometimes we need to duplicate data for audit tracking purposes but it isn't the norm.

It would help to see a snapshot of your relational graph (only the portion involved in this discussion and with it expanded showing only the keys). And it is true that you should normally use Set Field[].

Edited by Guest

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