Jump to content

YET ANOTHER SCRIPT PROBLEM


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

Recommended Posts

Hello, everyone!!

Ok, I am having yet another script problem, and now that I have written a couple of these, I have a question.

This script is suppose to look at a field that is attached to a value list, and see if a certain box is checked (an item in the value list selected), see if a field is empty, and print a letter to these people. It looks like this:

Go to Record/Request/Page [First]

Loop

If ["(PatternCount(Action List, "Appointment Obtained") > 0) and (IsEmpty(Letters2.2))

Set Field ["Letters2.2","Appt. Thanks""]

Insert Current Date [select, "Letters P Date 2.2"]

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

Else

If ["Status(CurrentRecordNumber) = Status(CurrentFoundCount)"]

Exit Loop If [1]

Else

Omit Record

End If

End If

End Loop

Go to Layout ["Pre-Appt Confirmation Letter"]

Page Setup

Enter Preview Mode

Print

Blah, Blah

This script seems to work for the most part, but I have only ONE record in my database that matches the search criteria. When the script is executed, it prints for the record that matches, but also prints for the LAST record in the database. I know this because I changed the sort order around a couple of times, but its always the record that matches and the last record. This last record does not fit the search criteria, and the fields "Letters2.2" and "Letters P Date 2.2" will not be set with the information that would be filled if it had matched the criteria, so I think it is slipping through the loop somehow. But it prints anyways. I think I have something in the wrong place, so if you guys could help, I would much appreciate it.

And now my question: If I put an IF Function in a script, and it looks through the records to find those who match, is it really necessary to have an Omit Record step for the recrods that dont match, or does FM simply ignore those records anyway??

Thats it, thanks for all your guys' help!

Ken

Link to comment
Share on other sites

Well, nevermind about the script problem, I think I know what I forgot... I need another Omit Record step here:

If ["Status(CurrentRecordNumber) = Status(CurrentFoundCount)"]

Omit Record <---here, right?

Exit Loop If [1]

Else

I tried it, and it seems to work now. But I still have the same question that was posed in the original post

Thanks guys

Ken

Link to comment
Share on other sites

This topic is 7310 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
 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.