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

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

Recommended Posts

Posted

Hi,

My program will automatically generate a record in a table when a condition is met. I am just wondering if the same condition happens again when I open the program and I what to prevent duplicated record, is using a flag(global) a good way to do the checking? Is there other way to do it? Thanks.

K.C.

Posted

Hi K.C.

What is the table and what is the condition? Ideally, you can use field-level validation to prohibit a new record under the same conditions you set for creating the record. But if you always use script to create new records then you can also test within the script before the New Record[] step and NOT create the new record. Global would not be dependable since it does not retain a set value when served (it reverts to the value placed in the field before it is served). If you have a one-record preferences table, you can store a value there and check it upon file open.

I am just throwing out concepts. Without details, we could not provide much else. If you wish to fill us in, we can be more specific. :^)

Posted

Hi LaRetta,

Thank you for you reply. I am trying to create a rental program that will automatically generate receipt a couple days before the due date. I want to avoid looping in each record to check because i think it may take too much time when open the program. Thank you for your help.

K.C.

http://fmforums.com/forum/topic/84750-looping-in-the-table-to-check-the-rent-end-date/

Posted

Then do you have many rental records each with different due dates? You can perform a find for records coming due. Your receipts should be another table and when a receipt (for that specific record's due date), it creates a record in the Receipts table. I can provide specific example but I need to know what tables are involved and whether you understand using primary and foreign keys (relating tables by their IDs).

How are your tables related?

Ooops, I didn't see that link you slid in. It is best to post back on a thread instead of creating a new one otherwise we must cover the same territory already covered AND it can be confusing on which place to answer.

Posting again about same question is discouraged. Did you try what was suggested and how did you end up? Please attach your file so we can see what you are doing. Thank you!

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