Jump to content

omit all but one duplicate record


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

Recommended Posts

  • Newbies

I have a DB with invoice file related to client file. When making monthly statements, each client will have multiple invoices per monthly statement. I want to print mailing labels from the found set of statements, but need to eliminate all but one duplicate client name & address fields (FROM EACH INVOICE). Each client has a unique client ID. WHEN WRITING A SCRIPT TO DO THIS THE Omit function in find function eliminates ALL. I need to retain one to print a mailing label.

Link to comment
Share on other sites

  • 1 year later...
  • 2 years later...

Dean -- thanks for posting that link. I'm still shaky with scripting, and especially looping skills and have a question about the loop in that solution:

Show All Records

Sort Records [Restore, No Dialog] Sort by Client ID in Ascending order

Go to Record/Request/Page [First]

Replace Field Contents [No dialog, 'Mark', " "]

Loop

Set Field['Global','ClientID']

Go to Record/Request/Page [Next, Exit after last]

If ['Global = ClientID']

Set Field ['Mark', '"X"']

Else

Set Field ['Global','ClientID']

End If

End Loop

Perform Find [Restore] Find records when Mark = X

Isn't the step I've placed in bold needlessly duplicated in this loop? it seems to me that the Global Field is set to the ClientID at the end of the loop sequence, and then again at the beginning of the loop sequence. I don't suppose it makes a difference, but I'm wondering whether the Loop wouldn't work fine if you just removed that second Set Field line -- or, what's more natural to my eyes, put the fit=rst one *before* the Loop begins, and leave the second one where it is?

It's maybe a petty question, but sometimes asking a question like this really helps me discover I'm not "getting" in Filemaker.

Link to comment
Share on other sites

You do need both "Set Global" steps but the first one should go above the Loop.

I'd script it a little differently, but rather than go there, I'm going to question your premise. Why not use a layout with a sub-summary part (by statement) that has the address fields on it?

Link to comment
Share on other sites

I'd script it a little differently, but rather than go there, I'm going to question your premise. Why not use a layout with a sub-summary part (by statement) that has the address fields on it?

THanks for the reply, Fitch -- I wasn't the original poster, just happened on the thread and like to read things that address topics I'm working toward competence on. Based on your reply I think I'm understanding that scrip[t ok.

Link to comment
Share on other sites

Once again I'm roped into answering a 3-year old thread. Glad it helped you, at least.

Link to comment
Share on other sites

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