merkaba22 Posted March 2, 2010 Posted March 2, 2010 I posted this question in the Portals area since it originally is regarding copying records from one portal to another but I got no response regarding the issue with the last step of the script for looping to the last record. It was originally based on the example, Example_mod1.zip, made by lastpass (http://fmforums.com/forum/showtopic.php?tid/211726/). The last step of the loop is End Loop If ( Max ( Packageonedata::PoneID ) ) I imported the script from the example and modified it to mine and through some trial and error (I realize that fields names cannot include a digit or a "_", apparently) I got it very close. However, the script, otherwise, does it all correctly except it goes through the loop once and stops -- it creates the first two records .... Accordingly, I suspect the last step of the loop which would otherwise continue appropriately: Max (Packageonedata::PoneID). When I compare this to: Max ( EstimateLine::EstimateID ) in the given example, I review that PoneID is defined as a number, auto-enter serial like EstimateID and that ESTID like WorkTicketNo, is a text field with minimal indexing. Count( EstimateLine::EstimateID) being a calc resulting in a number (do not evaluate if ...) is as Count(Packageonedata::PoneID) The field "count" in each case functions to create the number "1" and appears in each record correctly since putting these field(s) on the layout show that each work like each other ... and yet the script does not loop ... Its an interesting technique but new to me -- is there something I am missing or an alternate parameters for creating a working loop with a minimum of changes? I have attached the example as well as a screen shot of my script for comparison -- any help on this would be greatly appreciated. package1_to_estimate_42.pdf Example_mod1.fp7.zip
efen Posted March 2, 2010 Posted March 2, 2010 "I posted this question in the Portals area ..." So does that mean you have double posted?
merkaba22 Posted March 2, 2010 Author Posted March 2, 2010 Well, someone caught the second post before I recalled to remove the prior post -- but now this is the only post.
David Jondreau Posted March 2, 2010 Posted March 2, 2010 As usual, Filemaker is doing what you tell it to. Exit Loop If[Max(PackageoneData::PhoneID)] This means Exit the loop if the Maximum of all the PhoneIDs is not zero. I assume you're trying to get your Exit test should be: Count(Estimate::EstimateID) = Count(Polymer::PolymerID) or whatever field names you're using. Your pdf example is not from your fp7 example.
merkaba22 Posted March 2, 2010 Author Posted March 2, 2010 Here's my db for comparison. Thanks again:) Loop_script_error.fp7.zip
merkaba22 Posted March 2, 2010 Author Posted March 2, 2010 Thanks for the input but, and forgive me if I am wrong, I don't see how that idea will work if the target table already has other records, like in the example -- I would be concerned that the two values would not match. Also, in the example I forwarded, the last script step in the loop works as required; just not sure why mine does not -- sorry for the lack of clarity but the pdf is of my work, now provided in a later posting.
merkaba22 Posted March 2, 2010 Author Posted March 2, 2010 Hey DJ -- thanks again; I gave it more thought and tried the idea that the script could include steps "Show all records" and then "Omit Omitted Only" in the target table before the new record request is made -- and you know what? It worked. Thanks again:)
merkaba22 Posted March 3, 2010 Author Posted March 3, 2010 Did anyone figure out why I could not duplicate the Example_mod1.fp7.zip example in my example, Loop_script_error.fp7.zip ? I would love to learn what I was overlooking --- thanks in advance:)
Recommended Posts
This topic is 5379 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