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 5859 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Hi there,

See the attached file. Before performing an entry in the General Ledger, I want to make sure there are no duplicates of the data I am about to transfer there. Please check the Search Duplicates script in the General Ledger file and see what's wrong.

To figure out how the data transfer works, it all starts with the Entry General Ledger script in the Accounts Payable file. See the Blue Book icon on the left-hand side in the same file.

Thanks

Accounting.zip

Posted

Well, I think you meant to have "Halt Script" instead of "Exit Script" in the General ledger Search Duplicates script.

But, there are a few potential pitfalls with this routine. Why not just create a relationship between account code and ledger code and check for the existence of related records to avoid dupes?

Posted

The issue is:

If [ GeneralLedger::Counter = 1 ]

... you think you only have one record

End If

... but, you are checking only the current record's field named Counter to see if it contains a 1. You should instead use:

If [ Get ( FoundCount ) = 1 ]

because if your found count is greater than 1 then you have a duplicate.

LaRetta

Posted (edited)

I believe that the the OP considers a 'duplicate' to be a potential duplicate - when a single record already exists with the specified ledger code, not two or more. See the 'Entry General Ledger' script in the accounts file that triggers the find duplicates subscript. So, his original if statement will work (because it is really checking for any records being found at all), but will not stop the original script from completing (because 'Exit Script' is being used instead of 'Halt Script') as is the suggested functionality. Either way, we have demonstrated one of the potential pitfalls of this design - not very intuitive.

Edited by Guest
added script name
Posted

Thanks. I confess that I didn't check it very carefully this time; I spotted that If[] test and answered. :crazy2:

And you are right ... not very intuitive.

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