Bikeman17 Posted January 6, 2009 Posted January 6, 2009 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
Razumovsky Posted January 6, 2009 Posted January 6, 2009 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?
LaRetta Posted January 6, 2009 Posted January 6, 2009 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
Razumovsky Posted January 6, 2009 Posted January 6, 2009 (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 January 6, 2009 by Guest added script name
LaRetta Posted January 6, 2009 Posted January 6, 2009 Thanks. I confess that I didn't check it very carefully this time; I spotted that If[] test and answered. And you are right ... not very intuitive.
Bikeman17 Posted January 6, 2009 Author Posted January 6, 2009 I just replaced the Exit script by Halt and it worked fine. Thank you guys for the tip!
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now